-
i tried looking around but was unable to find any answer. I went looking at the documentation and samples for livecharts1.0 - WPF, which gives this code: var myChart = new LiveCharts.Wpf.CartesianChart
{
DisableAnimations = true,
Width = 600,
Height = 200,
Series = new SeriesCollection
{
new LineSeries
{
Values = new ChartValues<double> {1, 6, 7, 2, 9, 3, 6, 5}
}
}
};
var viewbox = new Viewbox();
viewbox.Child = myChart;
viewbox.Measure(myChart.RenderSize);
viewbox.Arrange(new Rect(new Point(0, 0), myChart.RenderSize));
myChart.Update(true, true); //force chart redraw
viewbox.UpdateLayout();
SaveToPng(myChart, "chart.png"); But myChart doesnt contain the function Update(bool, bool) and if it try to run the code i get a System.NullReferenceException on this row: viewbox.Arrange(new Rect(new Point(0, 0), myChart.RenderSize)); If someone could at least point me in the right direction, id be ever so happy. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Use SKCartesianChart to save the chart as a PNG file:
|
Beta Was this translation helpful? Give feedback.
Use SKCartesianChart to save the chart as a PNG file: