Search code examples
windows-phone-7chartsvisifire

Visifire.Charts How to disable vertical lines. WP


Chart is created by code. But I can't disable vertical lines in chart. It is a code of creating chart:

        public void CreateChart() {
        CleanChart();

        visiChart = new Chart()
        {
            ToolTipEnabled = true,
            Width = 400,
            Height = 200,
            Padding = new Thickness(0),
            Margin = new Thickness(0, 6, 0, -12),
            Background = new SolidColorBrush(Colors.White),
        };

        ChartGrid grid = new ChartGrid()
        {
            Enabled = false
        };
        DataSeries dataSeries = new DataSeries();
        DataPoint dataPoint;
        Axis yAx = new Axis()
        {
            AxisLabels = new AxisLabels() { Enabled = false },
            Grids = new ChartGridCollection() {grid}
        };

        int i = 0;
        var deps = App.CurrentAgreement.Deposits.Deposit.Where(x => x.DepositIliv + x.DepositLink > 0).ToList();

        foreach (var dep in deps) {
            dataPoint = new DataPoint();
            dataPoint.YValue = dep.DepositIliv + dep.DepositLink + dep.UValue + dep.WarrantyValue;
            dataPoint.XValue = i;
            i++;
            dataPoint.LabelText = dataPoint.YValue.Out();
            dataPoint.AxisXLabel = DateTime.Parse(dep.DepositDate).ToString("MMM yyyy");
            dataPoint.MouseLeftButtonUp += dataPoint_MouseLeftButtonUp;
            dataSeries.DataPoints.Add(dataPoint);
        }
        dataSeries.LabelEnabled = true;
        dataSeries.RenderAs = RenderAs.Column;
        dataSeries.Color = new SolidColorBrush(Colors.Green);
        visiChart.Series.Add(dataSeries);
        visiChart.AxesY.Add(yAx);

        ChartPlaceHolder.Children.Add(visiChart);
    }

But i dont need vertical lines visible. It is a screen of chart.

chart

How i can disable lines?? Help me, please.


Solution

  • You have to disable the Grid lines from AxisX also.

    Example:

    ChartGrid grid = new ChartGrid()
    {
        Enabled = false
    };
    
    Axis xAx = new Axis();
    xAx.Grids.Add(grid);
    visiChart.AxesX.Add(xAx);