Everything I find on composite charts is about yAxis with different values. Is it possible to have a composite chart with different xAxis values. For example I have the chart declared in the code below. For each series in the scatterline portion of the chart I want to display a "range" (i.e. high/low) values for that series. The caveat is that the range values will always be xAxis values of 6, 12, 26, 52, 104 with whatever corresponding yAxis values. The scatter line data might be slightly different so in the code below the xAxis values are 7, 13, 22, 51, 101 with an interval of 8.
For the data would I simply add high/low values to the data array like the following? For now the values are hard coded for a demo but eventually we will be pulling them from a production SQL server database.
var lineData = [ { "arg": 0.0, "val": 0.0, "high": 0, "low": 0 }, { "arg": 7, "val": 0.035, "high": 0.041, "low": 0.023 }, ... ];
Any help would be appreciated. Thanks
Sample code:
<div class="chartContainer"> <div class="chart"> <%--<h4>Scatter Line</h4>--%> <div id="chartScatterLine"></div> </div> </div> <!-- Custom Tooltip Template --> <script id="tooltipTemplateMedial" type="text/x-jquery-tmpl"> <div style="color: #44ACD6"> <span>Medial</span><br /> <span>Exam Followup Week: </span><span>${item.arg}</span><br /> Translation (mm): <span style="font-weight: bold">${item.val}</span> </div> </script> <script id="tooltipTemplateProximal" type="text/x-jquery-tmpl"> <div style="color: #44ACD6"> <span>Proximal</span><br /> <span>Exam Followup Week: </span><span>${item.arg}</span><br /> Translation (mm): <span style="font-weight: bold">${item.prc}</span> </div> </script> <script id="tooltipTemplateLateral" type="text/x-jquery-tmpl"> <div style="color: #44ACD6"> <span>Lateral</span><br /> <span>Exam Followup Week: </span><span>${item.arg}</span><br /> Translation (mm): <span style="font-weight: bold">${item.lat}</span> </div> </script> <script type="text/javascript"> $(function () { function createScatterChart(selector, seriesType, dataSource) { $(selector).igDataChart({ width: "500px", height: "400px", legend: { element: "lineLegend" }, dataSource: dataSource, title: "Stem Translation", axes: [{ name: "xAxis", type: "numericX", interval: 13, title: "Week" }, { name: "yAxis", type: "numericY", title: "Translation (millimeters)", maximumValue: 1.5, formatLabel: function (val) { //var bVal = (val / 1000), rounded = Math.round(val * 1000) / 1000; return rounded; } }], series: [{ isDropShadowEnabled: true, shadowOffsetX: 0, shadowOffsetY: 3, useSingleShadow: false, shadowColor: "#666666", name: "medial", type: seriesType, xAxis: "xAxis", yAxis: "yAxis", xMemberPath: "arg", yMemberPath: "val", markerType: "circle", showTooltip: true, tooltipTemplate: "tooltipTemplateMedial", thickness: 3, title: "Medial" }, { isDropShadowEnabled: true, shadowOffsetX: 0, shadowOffsetY: 3, useSingleShadow: false, shadowColor: "#666666", name: "proximal", type: seriesType, xAxis: "xAxis", yAxis: "yAxis", xMemberPath: "arg", yMemberPath: "prc", markerType: "circle", showTooltip: true, tooltipTemplate: "tooltipTemplateProximal", thickness: 3, title: "Proximal" }, { isDropShadowEnabled: true, shadowOffsetX: 0, shadowOffsetY: 3, useSingleShadow: false, shadowColor: "#666666", name: "lateral", type: seriesType, xAxis: "xAxis", yAxis: "yAxis", xMemberPath: "arg", yMemberPath: "lat", markerType: "circle", showTooltip: true, tooltipTemplate: "tooltipTemplateLateral", thickness: 3, title: "Lateral" }], horizontalZoomable: true, verticalZoomable: true, windowResponse: "immediate" }); } var lineData = [ { "arg": 0.0, "val": 0.0 }, { "arg": 6, "val": 0.035 }, { "arg": 12, "val": 0.090 }, { "arg": 26, "val": 0.079 }, { "arg": 52, "val": .088 }, { "arg": 104, "val": .33 }, { "arg": 0.0, "prc": 0.0 }, { "arg": 6, "prc": -1.316 }, { "arg": 12, "prc": -1.301 }, { "arg": 26, "prc": -1.334 }, { "arg": 52, "prc": -1.23 }, { "arg": 104, "prc": -1.43 }, { "arg": 0.0, "lat": 0.0 }, { "arg": 6, "lat": -1.47 }, { "arg": 12, "lat": -1.512 }, { "arg": 26, "lat": -1.567 }, { "arg": 52, "lat": -1.725 }, { "arg": 104, "lat": -1.869 } ]; createScatterChart("#chartScatterLine", "scatterLine", lineData); }); </script> <table> <tr> <td id="lineLegend" style="float: left"/> </tr> </table>
Hi,
I am not pretty sure I understood you completely about your scenario. If you want to display a range, then I suggest to use a candlestick series like shown in http://www.igniteui.com/data-chart/financial-series or a range column series as shown in http://www.igniteui.com/data-chart/range-category-series
Please let me know if I misunderstood you or if you have other questions on the matter.
I followed the sample code in the links. I tried just a single chart...didn't get into the composite chart thing...but I can only get the rangeArea chart to work when setting the xAxis to a categoryX...it diesn't work with numericX...
in my program is at to numericX...the premise is that I am showing a scatter line chart...and for each timepoint I want to show the high/low values at that xAxis value timepoint.
here is my sample chart code
$(function () { function createScatterChart(selector, seriesType, dataSource) { $(selector).igDataChart({ width: "500px", height: "400px", legend: { element: "lineLegendFemoralRotation" }, dataSource: dataSource, title: "Stem Rotation (degs)", axes: [{ name: "xAxis", type: "categoryX", title: "Year" }, { name: "yAxis", type: "numericY", title: "Rotation (deg)", interval: .25, maximumValue: 2, minimumValue: -2, formatLabel: function (val) { //var bVal = (val / 1000), rounded = Math.round(val * 1000) / 1000; return rounded; } }], series: [{ name: "medial", title: "Medial", type: seriesType, xAxis: "xAxis", yAxis: "yAxis", lowMemberPath: "lowData", highMemberPath: "highData", showTooltip: true, tooltipTemplate: "tooltipTemplateRx" }], horizontalZoomable: true, verticalZoomable: true, windowResponse: "immediate" }); } var lineData = [ { "arg": 0, "week": 0, "rx": 0, "lowData": 0.0, "highData": 0.0 }, { "arg": 6 / 52, "week": 6, "rx": 0.035, "lowData": 0.010, "highData": 0.090 }, { "arg": 12 / 52, "week": 12, "rx": 0.090, "lowData": 0.05, "highData": 0.13 }, { "arg": 26 / 52, "week": 26, "rx": 0.079, "lowData": 0.080, "highData": 0.19 }, { "arg": 52 / 52, "week": 52, "rx": .088, "lowData": 0.095, "highData": 0.30 }, { "arg": 104 / 52, "week": 104, "rx": .33, "lowData": 0.20, "highData": 0.5 } ]; createScatterChart("#chartFemoralRotation", "rangeArea", lineData); }); </script> <table> <tr> <td id="lineLegendFemoralRotation" style="float: left"/> </tr> </table>
did your site get hacked or is something awry? the igniteui site is 1/2 english and 1/2 chinese or japenese characters...doesn't matter what browser I use the view the site and my local settings are ENG - USA
Hristo:
I think we are on the same page. i do want to display a range... but for the second "axis" I don;t want to display y_axis or x_axis labels...just the data.
I tam thinking it has to be a composite chart. so I guess my question is can we display a scatterline and a range chart as a composite without the secondary axis labels showing?