Click here to Skip to main content
15,884,739 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ASP.NET
<dxchartsui:WebChartControl ID="WebChartControl1"  runat="server" Height="510px" Width="1000px"></dxchartsui:WebChartControl>

C#
WebChartControl1.DataSource = dt_Chart;
               //Values for X-axis
               WebChartControl1.SeriesDataMember = dt_Chart.Columns["Price"].ToString();
               //Values for Y-axis
               WebChartControl1.SeriesTemplate.ArgumentDataMember = dt_Chart.Columns["Time"].ToString();
               WebChartControl1.SeriesTemplate.ValueDataMembers.AddRange(new String[] {(dt_Chart.Columns["Price"].ToString())});
               string paletteName = "MyPalette";
               PaletteEntry entry1 = new PaletteEntry(Color.Green, Color.LightGreen);
               Palette palette = new Palette(paletteName, new PaletteEntry[] { entry1 });
               WebChartControl1.PaletteRepository.Add(paletteName, palette);
               WebChartControl1.PaletteName = paletteName;
               SideBySideBarSeriesView v = new SideBySideBarSeriesView();
               v.BarWidth = 0.4;

               WebChartControl1.SeriesTemplate.View = v;
               WebChartControl1.DataBind();


Hello,

The above code is working perfectly fine. The only problem is that the X Axis starts from 0 to 2600 with the interval of 200. So I wanted to change the value of X and Y Axis dynamically, reason behind it is that the data based on which my chart displays was not having much difference in Price. So the purpose to see the change in first glance is not fulfilled.

i.e, Price field has current value 2400, so for whole day the variation in the price is not much, it is like 2410/2415/2395/2399 and so on. So I was not able to see the change with neat & clean.

So I want to X and Y axis in a way that based on min and max value of Price and Time field I can change the start and End range of both axis.

Any suggestion is appreciated.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900