예제 #1
0
 private void Reset()
 {
     if (lvcChart.Series != null)
     {
         Helpers.ChartResetView(lvcChart);
         lvcChart.AxisX[0].LabelFormatter = GetLabelFormat;
         lvcChart.Series    = null;
         titleLabel.Content = Labels.NODATA;
     }
 }
예제 #2
0
        private void DisplayPage()
        {
            if (YValues != null)
            {
                int page = (int)pageSlider.Value;
                ChartValues <int> yChartValues = new ChartValues <int>();
                List <string>     xChartValues = new List <string>();

                int maxY = 1;
                for (int i = page; i < page + PageSize && i < YValues.Count; i++)
                {
                    maxY = Math.Max(maxY, YValues[i]);
                    yChartValues.Add(YValues[i]);
                    xChartValues.Add(XValues[i].ToString(CultureInfo.CurrentCulture) + (XValuesDiff[i] == 0 ? "" : " \n+" + XValuesDiff[i].ToString(CultureInfo.CurrentCulture)));
                }

                var series      = new SeriesCollection();
                var firstSeries = new ColumnSeries
                {
                    Values         = yChartValues,
                    DataLabels     = true,
                    LabelPoint     = point => point.Y.ToString(CultureInfo.CurrentCulture),
                    FontSize       = 14,
                    FontWeight     = FontWeights.Bold,
                    Foreground     = new SolidColorBrush(Colors.White),
                    MaxColumnWidth = 15,
                    ColumnPadding  = 8,
                    ScalesXAt      = 0
                };

                series.Add(firstSeries);

                lvcChart.DataTooltip = null;
                lvcChart.AxisX[0].Separator.StrokeThickness = 0;
                lvcChart.AxisX[0].Labels         = xChartValues;
                lvcChart.AxisY[0].Labels         = null;
                lvcChart.AxisY[0].Separator.Step = (maxY <= 10) ? 2 : double.NaN;
                lvcChart.Series = series;
                Helpers.ChartResetView(lvcChart);
            }
        }
예제 #3
0
 private void ChartDoubleClick(object sender, MouseButtonEventArgs e)
 {
     Helpers.ChartResetView(lvcChart);
 }
예제 #4
0
 private void RecenterClick(object sender, RoutedEventArgs e) => Helpers.ChartResetView(lvcChart);