Date in X-Axis - .Net Charts

前端 未结 2 1273
温柔的废话
温柔的废话 2021-01-24 08:34

i am working in .Net Charts. i want to show date in X-Axis. For ex : if i select Last 52 Weeks, then i should show the chart for last 52 weeks, whereas those 52 weeks start date

相关标签:
2条回答
  • 2021-01-24 08:51

    After a long search...i had fixed my above issue...but still i dont know how it works...

            Chart1.ChartAreas["ChartArea1"].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;
            Chart1.Series["Series1"].XValueType = ChartValueType.Date;
            DayOfWeek ds = DayOfWeek.Wednesday;
            double dblIntervalOffset = Convert.ToDouble(ds);
            Chart1.ChartAreas["ChartArea1"].AxisX.IntervalOffset = dblIntervalOffset;
            Chart1.ChartAreas["ChartArea1"].AxisX.Minimum = min;
            Chart1.ChartAreas["ChartArea1"].AxisX.Maximum = max;
            Chart1.ChartAreas["ChartArea1"].AxisX.Interval = 7;
            Chart1.ChartAreas["ChartArea1"].AxisX.IsMarginVisible = false;
    
    0 讨论(0)
  • 2021-01-24 08:51

    Indexed attribute must be set for series data.

    0 讨论(0)
提交回复
热议问题