Is there a way to call a Visiblox Chart that created with C# code in WPF?
Let’s say that i have created a chart like :
private Chart CreateNewChart(int num_chart, string chartName)
{
Chart newChart = new Chart();
newChart.Name = "Chart_"+num_chart;
newChart.Title = chartName;
newChart.Width = 600;
newChart.Height = 120;
newChart.Background = Brushes.Transparent;
newChart.HorizontalAlignment = HorizontalAlignment.Left;
newChart.VerticalAlignment = VerticalAlignment.Top;
newChart.Margin = new Thickness(0, (num_chart * 110), 0, 0);
BehaviourManager behaviour = new BehaviourManager();
behaviour.AllowMultipleEnabled = true;
TrackballBehaviour track = new TrackballBehaviour();
ZoomBehaviour zoom = new ZoomBehaviour();
behaviour.Behaviours.Add(track);
behaviour.Behaviours.Add(zoom);
newChart.Behaviour = behaviour;
return newChart;
}
And when I import some date from a CSV file, I want to add more data from another CSV file. Is there a way to call this created Chart with each name, or something?
Thanks in advance.
Then in your codebehind ‘myChart’ will be available and you can do all the setup and configuration of the chart in your MainWindow methods:
etc. ‘myChart’ will be scoped to your MainWindow class, so you can make whatever helper methods you need to setup you chart.
However, doing everything in code behind isn’t the WPF way, the WPF way would be to setup most or all of it in XAML. You can see the examples on their website in how to control the charts through XAML. http://www.visiblox.com/examples/LineChart