How to: Display multiple values within a single series

8 posts, 0 answers
  1. Ab
    Ab avatar
    11 posts
    Member since:
    Jul 2013

    Posted 04 Sep 2013 Link to this post

    We are looking to replicate your Silverlight example using WinForms.RadChartView. We need to be able to display multiple sections (represented by a color) within each bar (in your example - a country)

     

    In addition @ run time we need to be able to ... 

    1. Drop new values onto a specific bar (country)  and repopulate the chart to include the new value(s)
    2. Drag an item (represented by a color) from one bar (country) to another  and repopulate the chart to include the new value(s) or remove it altogether.

     

    • Is this possible in WinForms.RadChartView?
      • If yes, can you provide/point us to an example?
      • If not what are our options?
  2. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 09 Sep 2013 Link to this post

    Hi Abhinav,

    Thank you for writing.

    In order to display the desired "multiple sections" in RadChartView you can use the series CombineMode property. In the following topic you can find out which are the available modes for the property and how to use them: Bar.

    As to the other questions at hand, I want to ask you to provide me with a more detailed information perhaps even some screenshots on what exactly your goals are. I am asking you this because by default RadChartView does not have Drag&Drop service, but if we have more comprehensive information on what you are trying to achieve we might be able to provide you with solution.  

    Please let me know if there is something else I can help you with.

    Regards,
    Dimitar
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Ab
    Ab avatar
    11 posts
    Member since:
    Jul 2013

    Posted 09 Sep 2013 Link to this post

    Hi Dimitar,

    Thanks for the info.

    To explain briefly:

    We want to display the production planned for parts on various machines using a bar chart, The need is to move parts from Machine "A" to Machine "B", in this case machine "B" may be running under-capacity or currently running a single shift, therefore the purpose is to move a part scheduled on one machine to another and visually be able to compare the effects for the change.

    There may be 200+ parts stacked on say machine "A", where-as machine "B" may have 10 parts. This situation arises due to many factors which may be features, capability, size etc. 

    I hope this (with the help of the attached image) helps explain what we are attempting to achieve. .
  5. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 12 Sep 2013 Link to this post

    Hi Abhinav,

    Thank you for writing.

    I have created and attached a sample project. In the project you may find a sample implementation of the desired behavior. Feel free to use or modify it in any way that is suitable for your case.

    Please let me know if there is something else I can help you with.

    Regards,
    Dimitar
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. Ab
    Ab avatar
    11 posts
    Member since:
    Jul 2013

    Posted 13 Sep 2013 Link to this post

    Perfect! This is what I was looking for ...

    Is there a way to specify the color on each datapoint?

    Thanks for your help
  7. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 17 Sep 2013 Link to this post

    Hello Abhinav,

    Thank you for writing back.

    You can change the data point color with the following line of code:
    this.radChartView1.Series[1].Children[2].BackColor = Color.Red;

    But in this case this I will suggest that you set a border for the data points, because when you drop a point it will be cloned and its color will not be preserved. You can find a sample implementation of data points with border along with some improvements in the demo attached.

    I hope this helps. Should you have any other questions, I will be glad to assist you.

    Regards,
    Dimitar
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  8. Ab
    Ab avatar
    11 posts
    Member since:
    Jul 2013

    Posted 18 Sep 2013 Link to this post

    Thanks for that tip, Dimitar.

    How can I control the color (back & fore) of the label (see attached screenshot) it is currently displaying the label fore-color using the back-color I assign to the series. Therefore making the label unreadable!



  9. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 23 Sep 2013 Link to this post

    Hi Abhinav,

    Thank you for writing back.

    You can use the ChartTrackballController instance to change the backcolor of the TrackBall label. For the text color you can use the same instance, but you need to subscribe to the TextNeeded event and change the ForeColor there. This is needed because by default the text is html-like formated and just changing the ForeColor property won't take effect:
    ChartTrackballController TrackBar = new ChartTrackballController();
     
    TrackBar.Element.BackColor = Color.Red;
    radChartView1.Controllers.Add(TrackBar);
    TrackBar.TextNeeded +=c_TextNeeded;
     
    void c_TextNeeded(object sender, TextNeededEventArgs e)
    {
        string result = "";
     
        foreach (var item in e.Points)
        {
            result += item.Series.Name;
            result += " ";
            result += ((CategoricalDataPoint)item.DataPoint).Value;
            result += " ";
        }
        e.Text = result;
        e.Element.ForeColor = Color.DarkBlue;
    }

    Please let me know if there is something else I can help you with.

    Regards,
    Dimitar
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
UI for WinForms is Visual Studio 2017 Ready