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>
I have a sample of what we are trying to achieve. The sample has the xAxis categorized...We would need that numeric is the only difference. I can't upload to the forum...can you send me an email address that I can send the sample too?
Hello,
I'm just following up to see if you need any further assistance with this issue. If so please let me know.
Hi Chris,
I have been trying to figure this out for you, but am still unsuccessful. What you are trying to achieve is a combination of a scatterLine series with a range series/ However the scatterLine can go with a numeric axes, while the range series require categorized data to work. I know you understand that and just wanted to summarize the situation.
My hard efforts so far did not get me any success and this makes me think this scenario is not achievable, unless you decide to go with categorized data and rangeArea + line series, as my last attached sample shows. You can also log a Product Idea (using range series with numeric data) at http://ideas.infragistics.com, the Product Ideas site allows you to suggest new product features, new functionalities in existing products and controls, and even request new controls and products altogether. Members of the Infragistics Community then vote for the features and suggestions they want to see added to the products, resulting in the most popular features bubbling up to the top. When planning new releases, our Product Management team will look at the most popular features and use your feedback to prioritize upcoming work.
Below you will find more details on how to log a product idea. Please let me know if I may be of any further assistance to you.
Steps to create your idea:
1. Log into the Infragistics Product Ideas site at http://ideas.infragistics.com (creating a new login if needed).2. Navigate to the product / platform channel of your choice (e.g. WPF, Windows Forms, ASP.NET, HTML5 / Ignite UI, iOS / NucliOS, etc.)3. Add your product idea and be sure to be specific and provide as much detail as possible. Explain the context in which a feature would be used, why it is needed, why it can’t be accomplished today, and who would benefit from it. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. Be convincing!
The benefits of submitting the product idea yourself include:
- Direct communication with our product management team regarding your product idea.- Notifications whenever new information regarding your idea becomes available.
Additional benefits of the product idea system include:- Ability to vote on your favorite product ideas to let us know which ones are the most important to you. You will have ten votes for this and can change which ideas you are voting for at any time.- Allow you to shape the future of our products by requesting new controls and products altogether.- You and other developers can discuss existing product ideas with members of our Product Management team.
The product ideas site allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you
Hristo:
Unfortunately the RangeArea chart does not achieve the desired results. if you look back in the thread I already tried that. The problem is that the rangeArea chart xAxis is of type categoryX this puts the data points at equidistant positions along the xAxis. My data is not categorized is numeric (i.e. x,y value pairs). The x values represent weeks so the data for "6" week has to go extremely close the yAxis where as the week 12 goes double that distance and week 52 etc. So I need the range area capability with a numeric xAxis...or a viable workaround.
I will be willing to send you privately a demo URL that you can check the data out so you get a better understanding. can you PM me at chris.vandenheuvel@halifaxbiomedical.com?
Thank you for the clarifications over your requirement. This seems to be achievable using a RangeArea series type, not a scatterLine. Please have a look at a RangeArea chart at http://www.igniteui.com/data-chart/range-category-series and consider if this is what your chart should look like. If so, then you can also add a line that will draw the average of this values. Just a quick example of this is the attached sample - currently the red line draws the low values, but of course it can be modified to draw the average.
I see the ability now to upload a file...
So here's what we are trying to achieve. You will see two samples. The xAxis has to be numeric because our time points aren't perfectly contiguous and therefore cannot be categorized.
So each series would ideally have the patient data...(the solid green line) and then a band that shows the distribution (i.e. high/low range) and the dashed line shows the average of the group data.
What would be gravy would be if the series data could be coloured differently if part of it falls outside the normal distribution..that's the sample with the red line. Ideally if the patient data is inside the distribution it should be green (or colour of choice) and when it crosses outside the distribution it goes to red...I realize that part is probably a feature request.