开发者

Asp.net chart control interval not working?

开发者 https://www.devze.com 2023-02-26 03:59 出处:网络
I have asp.net chart intervel issue. I am feed data to chart like below X1Y1X2Y2 1009075002395 10074550023开发者_Python百科43

I have asp.net chart intervel issue. I am feed data to chart like below

X1        Y1       X2          Y2
100    907     500        2395
100    745     500        23开发者_Python百科43
100    760     500        2403

Each row is a series in the chart.

In am iterating each row in code and making new serie and adding to chart

 series1.Points.AddXY(dt.Rows(i)(0).ToString, dt.Rows(i)(1).ToString)
 series1.Points.AddXY(dt.Rows(i)(2).ToString, dt.Rows(i)(3).ToString)

chart is coming like it is fine.

Asp.net chart control interval not working?

Now I want make intervel like 100,200,300,400, 500 (500 is max of the graph).

I tried Chart1.ChartAreas(0).AxisX.Interval = 100, It did not worked out.


You can do it in markup:

    <asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1">
    <Series>
        <asp:Series ChartType="Line" Name="Series1" XValueMember="ID" 
            YValueMembers="Status">
        </asp:Series>
    </Series>
    <ChartAreas>
        <asp:ChartArea Name="ChartArea1">
            <AxisX Interval="30" IntervalType="Number">
            </AxisX>
        </asp:ChartArea>
    </ChartAreas>
</asp:Chart>
0

精彩评论

暂无评论...
验证码 换一张
取 消