Chart: changing Fields of Axis runtime dynamically

  1. #1

    Chart: changing Fields of Axis runtime dynamically

    Hi all,
    I render a chart in a panel, then I want to change in behind code by the user request the fields in AxisY.Field getting the corresponding data

    for example

            Chart MyChart = this.Chart1;
    
            CategoryAxis AxesX = new CategoryAxis();
            NumericAxis AxesY = new NumericAxis();
            ColumnSeries MySerie = new ColumnSeries();
    
           ...
    remove axes
    remove serie
    clear model
     .....
    
            AxesX.Title = "Month";
            AxesX.Fields = new string[1];
            AxesX.Fields[0] = "Date";
    
            AxesY.Minimum = 0;
            AxesY.Fields = new string[4];
            AxesY.Fields[0] = "Value1";
            AxesY.Fields[0] = "Value2";
            AxesY.Fields[0] = "Value3";
            AxesY.Fields[0] = "Value4";
      
    .. define model and serie
    
            MyChart.StoreID = "myStoreDefinedInAspx";
            MyChart.Animate = true;
            
            MyChart.Series.Add(MySerie);
            
            MyChart.Legend = true;
            MyChart.Axes.Add(AxesX);
            MyChart.Axes.Add(AxesY);
    and in the following request instead of Value1,2,3,4 user asks for Value5,6,7,8

    which is the right path to achieve this goal, if possible?

    Thanks
  2. #2

    Re: Chart: changing Fields of Axis runtime dynamically

    This link is a bit stale, but hopefully this will help someone else. Here is another link that talks about dynamic chart and store but also deals with dynamically adding fields:

    http://forums.ext.net/showthread.php...hart-and-Store

    Quote Originally Posted by tanky65 View Post
    Hi all,
    I render a chart in a panel, then I want to change in behind code by the user request the fields in AxisY.Field getting the corresponding data

    for example

            Chart MyChart = this.Chart1;
    
            CategoryAxis AxesX = new CategoryAxis();
            NumericAxis AxesY = new NumericAxis();
            ColumnSeries MySerie = new ColumnSeries();
    
           ...
    remove axes
    remove serie
    clear model
     .....
    
            AxesX.Title = "Month";
            AxesX.Fields = new string[1];
            AxesX.Fields[0] = "Date";
    
            AxesY.Minimum = 0;
            AxesY.Fields = new string[4];
            AxesY.Fields[0] = "Value1";
            AxesY.Fields[0] = "Value2";
            AxesY.Fields[0] = "Value3";
            AxesY.Fields[0] = "Value4";
      
    .. define model and serie
    
            MyChart.StoreID = "myStoreDefinedInAspx";
            MyChart.Animate = true;
            
            MyChart.Series.Add(MySerie);
            
            MyChart.Legend = true;
            MyChart.Axes.Add(AxesX);
            MyChart.Axes.Add(AxesY);
    and in the following request instead of Value1,2,3,4 user asks for Value5,6,7,8

    which is the right path to achieve this goal, if possible?

    Thanks

Similar Threads

  1. Replies: 2
    Last Post: Aug 13, 2012, 2:12 PM
  2. [CLOSED] Area chart starting axis
    By Fahd in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 05, 2012, 8:56 PM
  3. [CLOSED] changing title of a chart serie
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: May 22, 2012, 4:56 PM
  4. Changing store runtime for gridpanel
    By masudcseku in forum 1.x Help
    Replies: 7
    Last Post: May 12, 2011, 11:14 PM
  5. Changing event mask Msg dynamically
    By okutbay in forum 1.x Help
    Replies: 0
    Last Post: Mar 09, 2010, 8:23 AM

Tags for this Thread

Posting Permissions