livecharts

LiveChart doesn't show all Labels on x-axis WPF

不打扰是莪最后的温柔 提交于 2020-01-04 02:53:28
问题 i am using LiveChart and loading some data. <wpf:CartesianChart Name="LineChart" LegendLocation="top" > <wpf:CartesianChart.AxisY> <wpf:Axis Title="Sales" ></wpf:Axis> </wpf:CartesianChart.AxisY> <wpf:CartesianChart.AxisX> <wpf:AxesCollection> <wpf:Axis Labels="{Binding Labels}"> <wpf:Axis.Separator> <wpf:Separator Step="1" /> </wpf:Axis.Separator> </wpf:Axis> </wpf:AxesCollection> </wpf:CartesianChart.AxisX> while on backend i have defined Labels. public DailySalesProgressLineChart() {

Individually colored data points in LiveCharts WPF

自闭症网瘾萝莉.ら 提交于 2020-01-01 06:19:49
问题 I am using Live Charts WPF to draw some charts. To make each column bar of different color I added multiple series, but it doesn't show x-axis labels of all series. Why? senderChart.Series = new SeriesCollection(); int i = 0; var ax = new Axis { Separator = new LiveCharts.Wpf.Separator() { Step = 1 }, Labels = dateValues, ShowLabels = true }; senderChart.AxisX.Add(ax); foreach (var val in dataValues) { senderChart.Series.Add(new ColumnSeries { DataLabels = true, Title = dateValues[i], Values

How do I correctly update my chart values? (In real time)

拈花ヽ惹草 提交于 2019-12-30 22:52:58
问题 I recently encountered a tool called LiveChart and decided to test it out. Unfortunately I've been having some problems figuring out how to update the chart values in real time. I'm pretty sure there's a clean and correct way of doing it, but I can't seam to find it. I would like to be able to update the values through a private void or button. In my code I'm testing it out with a ToolStripMenu. [CODE]: using System; using System.Collections.Generic; using System.ComponentModel; using System

Render image from UserControl that has LiveChart

你说的曾经没有我的故事 提交于 2019-12-25 03:17:18
问题 I kept rendering a black/blank image of a UserControl not shown in window. The UserControl contains LiveChart's CartesianChart and few UIElements. First I borrowed solutions from SO: C# chart to image with LiveCharts and Github: Live-Charts/ChartToImageSample.xaml.cs and apply SaveToPng and EncodeVisual on a simple UIControl generated in runtime (not added or shown in window), which works. Canvas control = new Canvas() { Width=100, Height=100, Background = new SolidColorBrush(Colors.Pink)};

How to create a Pie Chart with LiveCharts

断了今生、忘了曾经 提交于 2019-12-25 01:33:03
问题 I need help creating a (test) pie chart with LiveCharts. I am using this xaml code <Grid> <lvc:PieChart x:Name="myPieChart"/> </Grid> and then in code behind LiveCharts.Wpf.PieSeries ps = new LiveCharts.Wpf.PieSeries { Values = new LiveCharts.ChartValues<decimal> { 1, 3} }; myPieChart.Series.Add(ps); But instead of getting one pie chart with 2 slices, I get 2 concentric pie charts, each with 1 complete slice only. 回答1: Ok, I was able to get the job done by doing this LiveCharts

Change the format of the axis tick labels in LiveCharts

旧巷老猫 提交于 2019-12-23 17:16:35
问题 I just can't find a solution for changing the format of the y-axis tick labels. Now I get labels like 0.03 and 0.035 . But I always need three digits behind the decimal point. The big question is, how to access the label format? This is my code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Forms; using System

WinForms Livecharts Chart Title

大憨熊 提交于 2019-12-20 03:21:47
问题 I'm using LiveCharts in WinForms. Reason why I'm not using WPF is because I don't want to rewrite the GUI in WPF, so I'm trying to see if I can make LiveCharts work in WinForms. I'm saving the LiveCharts control as an image to a PDF, so the title needs to be on the chart itself. I cannot find any functionality for adding a title on the chart. What I have tried is the following: VisualElement title = new VisualElement(); title.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;

How to make the x Axis to start on 0 and have a step of 2 seconds, instead of staring on a second the program started, using Livecharts?

爱⌒轻易说出口 提交于 2019-12-14 02:38:18
问题 I am using sample code from live charts Code behind private double _axisMax; private double _axisMin; public Plotter() { var mapper = Mappers.Xy<MeasureModel>() .X(model => model.DateTime.Ticks) //use DateTime.Ticks as X .Y(model => model.Value); //use the value property as Y //lets save the mapper globally. Charting.For<MeasureModel>(mapper); //the values property will store our values array ChartValues = new ChartValues<MeasureModel>(); //lets set how to display the X Labels

How to zoom and pan multiple charts with livecharts library

好久不见. 提交于 2019-12-13 03:43:57
问题 I'm using beto-rodriguez's livecharts for WPF. I get data for charts from xml file and than i draw charts one above another, charts representing data have same number of spots on X axis and ZOOM and PAN are enabled with ch.Zoom = ZoomingOptions.X; and ch.Pan = PanningOptions.X; My question is possible to zoom or pan one (doesnt matter which) of those charts and that all of them are zoomed or panned so that i have vertically aligned X axis of all of them? Basically if I zoom or pan on one

Livecharts not displaying Label on x axis in WPF

ぐ巨炮叔叔 提交于 2019-12-11 12:59:20
问题 I am displaying data in my livecharts and Label values are binded (visible in debugging). But somehow in the UI, it is showing one or two values instead of all the values in string array from the backend. Model.cs Code: private string[] _Labels; public string[] Labels { get { return _Labels; } set { SetProperty(ref _Labels, value); } } ModelViewCode.cs Labels = new[] {"Maria", "Susan", "Charles", "Frida"}; XAML: <lvc:CartesianChart.AxisX> <lvc:Axis Labels="{Binding Labels}"> </lvc:Axis> </lvc