Keeping Chart format

5 posts, 0 answers
  1. Joe Banko
    Joe Banko avatar
    4 posts
    Member since:
    Apr 2010

    Posted 27 Apr 2010 Link to this post

    I have a chart which plots quite a few data point, as high as 300 on 3 series which comes from an array. I have the EXACT look that I want and populate it with;

                    radChart1.DataSource = Glb.dataArray;

                    radChart1.DataBind();



    This works fine except all the formatting I setup is gone. I now have 900 labels which I had turned off. The line color changes to a look which doesn't match the rest of the window. Is there a way to just change the data without the rest of the chart getting changed to formatting which I don't want?

    Thanks,

    Joe B
  2. Joe Banko
    Joe Banko avatar
    4 posts
    Member since:
    Apr 2010

    Posted 27 Apr 2010 Link to this post

    I have gotten a little farther I think. My chart has three series defined, roll, pitch, theta. No data points, just the series name. I retrieve my data and put it in an array, aArray. I point to the the chart series with;

                    ChartSeries roll = radChart1.Series.GetByName("roll");

                    ChartSeries pitch = radChart1.Series.GetByName("pitch");

                    ChartSeries theta = radChart1.Series.GetByName("theta");


    And then populate each of the series with:

                    for (int x = 0; x < Glb.Units + 1; x++)

                    {

                        ax = Math.Abs(Glb.aArray[x, 0]);

                        ay = Math.Abs(Glb.aArray[x, 1]);

                        az = Math.Abs(Glb.aArray[x, 2]);

                        roll.AddItem(ax);

                        pitch.AddItem(ay);

                        theta.AddItem(az);

                        

                    }




    When I look at the chart I see the data IN each of the chart series items. But I still get the annoying "No data in series or empty data series" HOW can this be?????

    Joe B
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 30 Apr 2010 Link to this post

    Hi Joe,

    Let me start with your initial question. When databinding RadChart clears its existing series and creates its own ChartSeries for each numeric property/field in the underlying datasource. This might lead to the loss of styles you have observed. Still, RadChart allows you do define your ChartSeries before databinding -- set the ChartSeries.DataYColumn property -- this way RadChart will not clear the ChartSeries, but it will use them, so you will keep the appearance settings you have already configured.

    As for the no data message -- this seems strange to me, as your code clearly shows that items are added to the series unless Gib.Units return -1, so that the code in the loop is not executed. Please, give the above suggestion a try and let me know if it helps.

    Kind regards,
    Ves
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Brad
    Brad avatar
    46 posts
    Member since:
    Dec 2008

    Posted 04 May 2010 Link to this post

    I'm not really clear on what you mean. Could you give me a simple example of setting the DataYColumn?

    Thanks,

    Joe B
  6. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 06 May 2010 Link to this post

    Hi Joe,

    Please, find attached a small example.

    Best regards,
    Ves
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top
UI for WinForms is Visual Studio 2017 Ready