I want to add some new lines to my chart dynamically and am using MVVM
I can see how to add my lines to the chart series, but am unsure how to add the various YAxis etc
From the code below, you can see I have passed a reference to my SciChartSurface to the Viewmodel at construction, and by using this I can dynamically add a Yaxis (R3), but now need to and YAxisDragModifier to the axis but am not sure how to do this? Is there any better documentation than the Class Library Documentation or better examples on MVVM that I have not found that shows dynamic adding of lines, axis etc, or could you help me get this going please?
Thanks
NumericAxis na = new NumericAxis(); na.VisibleRange = new DoubleRange(0, 500); na.AxisAlignment = AxisAlignment.Right; na.Id = "R3"; sciChart.YAxes.Add(na); YAxisDragModifier ydm = new YAxisDragModifier(); ydm.YAxisId ="R3"; // How do I add this now???????
- wilx asked 12 years ago
- You must login to post comments
Hi there,
Please, find attached example project, which demonstrates SciChart with MVVM usage. Regarding documentation, we are going to improve the situation, also to add more MVVM examples – you are right, there is a lack of them in our example suite. Also there are several tutorials on the site, you probably find lots of useful info there, you could take a look at SciChart tutorials.
Please, feel yourself free to ask if you have any more questions.
Best regards,
Yuriy
- Yuriy Zadereckii answered 12 years ago
-
Thanks, that's good, it has got be a bit further but I as still having problems as I want to be able to add an axis and a YAxisDragModifier dynamically. In your example, you add your modifiers at construction time
ChartModifier = new ModifierGroup(yAxisDrag, xAxisDrag, zoomExtents, rubberBandZoom, panModifier);
but I now want to add a new axis with a YAxisDragModifier dynamically ieyAxis2 = new NumericAxis { Id = "YAxis2", AxisTitle = "Second Axis" }; YAxes.Add(yAxis2); var yAxis2Drag = new YAxisDragModifier { YAxisId = "YAxis2" }; ChartModifier. // Add yAxis2Drag to modifier list here please
- You must login to post comments
Please login first to submit.