Why hide a bar series when radChartView is minimized?!

4 posts, 0 answers
  1. Zahra
    Zahra avatar
    2 posts
    Member since:
    Oct 2017

    Posted 29 Oct Link to this post

    Hi

    I have multiple datapoints in my barseries but when my radchartview is Smaller than specific size columns that have little value is hidden.

    in Q1.png when windows is smaller size than Q2.png

    what I do?!!

     

  2. Dess
    Admin
    Dess avatar
    2222 posts

    Posted 31 Oct Link to this post

    Hello, Zahra,

    Thank you for writing.  

    Note that by default the BarPointElements have a border 1 px and it participates in the calculation for drawing the rectangle. That is why when the value is so small and the border's width is subtracted the height of the BarPointElement is 0. The possible solution that I can suggest is eliminating the border by using the following code snippet:

    BarSeries barSeries = new BarSeries("Performance", "RepresentativeName");
              barSeries.Name = "Q1";
                
              barSeries.DataPoints.Add(new CategoricalDataPoint(177, "Harley"));
              barSeries.DataPoints.Add(new CategoricalDataPoint(128, "White"));
              barSeries.DataPoints.Add(new CategoricalDataPoint(143, "Smith"));
              barSeries.DataPoints.Add(new CategoricalDataPoint(111, "Jones"));
              barSeries.DataPoints.Add(new CategoricalDataPoint(1, "Marshall"));
              this.radChartView1.Series.Add(barSeries);
     
              foreach (BarPointElement  barElement in barSeries.Children)
              {
                  barElement.BorderWidth = 0;
              }

    I hope this information helps. Should you have further questions I would be glad to help.

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Zahra
    Zahra avatar
    2 posts
    Member since:
    Oct 2017

    Posted 07 Nov in reply to Dess Link to this post

    Hi Dess :)

    Thank you for your reply.

    Your code worked. Now I have another question. May you help me please?

    Question is :  How to set width for bar element or bar series?!

    Because when I have one series with one bar element and one category my bar element is so wide.

    thanks so much.

  4. Dess
    Admin
    Dess avatar
    2222 posts

    Posted 08 Nov Link to this post

    Hello, Zahra,    

    Thank you for writing back. 

    The bar element is automatically stretched considering the ticks' range for the specific value. However, you can control the width by the GapLength property of the horizontal axis. The bigger the gap is, the smaller the bar element is. You can refer to the second part of the following help article for additional information: https://docs.telerik.com/devtools/winforms/chartview/series-types/bar

    I hope this information helps. If you have any additional questions, please let me know. 

     Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top