Combining bar & line in same chart

12 posts, 1 answers
  1. Sivam
    Sivam avatar
    37 posts
    Member since:
    Jan 2010

    Posted 28 Apr 2010 Link to this post

    Hi,

    I'm new to reporting. Can anyone tell me whether can combine bar & line chart in same chart? i.e to have 2 Y axis(Y1 with bar & Y2 with line)

    Thanks in advance
  2. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 30 Apr 2010 Link to this post

    Hello Sivam,

    Your requirement is achievable with the Telerik Reporting Chart item. In order to combine a Bar and a Line Chart you have to create two Series with the following configuration:
    • Series1 Type property set to Bar and YAxisType property set to Primary
    • Series2 Type property set to Line and YaxisType property set to Secondary


    Greetings,
    Peter
    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.
  3. DevCraft banner
  4. Sivam
    Sivam avatar
    37 posts
    Member since:
    Jan 2010

    Posted 05 May 2010 Link to this post

    Thanks, i got.
    I've another question. How can i make 3 combinations. See attached for sample. Need to know whether possible?
  5. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 06 May 2010 Link to this post

    Hi Sivam,

    I am afraid the image shows two series -- bar and line. Still, I can confirm -- it is possible to add 3 chart series  be it 3 bar series, 2 bar series and one line, etc. Just follow the guidlines provided by Peter.

    Note, that there is a limitation you must be aware of -- the chart item can only have 2 Y axes - a primary and a secondary, so when you add 3 series you will have to choose one of these for each of them, there is no way to have 3 Y axes.

    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.
  6. Sivam
    Sivam avatar
    37 posts
    Member since:
    Jan 2010

    Posted 06 May 2010 Link to this post

    Thanks for the response. Let me be clear on my question. Pls find sample chart attached. Top part can be done following Peter advice. I would like to know how to get the below part showed inside green box.
    The data values of both Y axis in the chart needs to be shown below the chart in table format relating to the chart. Is this possible?
  7. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 11 May 2010 Link to this post

    Hi Sivam,

    You can use the following line:

    myChart.PlotArea.DataTable.Visible = true;

    This will force the chart to display a data table like the one demonstrated in chart.png.

    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.
  8. Sivam
    Sivam avatar
    37 posts
    Member since:
    Jan 2010

    Posted 13 May 2010 Link to this post

    Thanks. That works.

    Now i have another question. I've 2 series. Series 1 with bar and series 2 with line. I've Y & Y2 axis. Series 1 item is linked to Y axis. Series 2 item are also linked to Y axis. How can i make series 2 items link to Y2 axis? see attached chart for example. Series 2 items (line) should be based on Y2 axis and not Y axis. How to get it done?

    Thanks in advance.
  9. Answer
    Ves
    Admin
    Ves avatar
    2879 posts

    Posted 14 May 2010 Link to this post

    Hello Sivam,

    You can set the YAxisType property of the ChartSeries to ChartYAxisType.Secondary:

    myLineSeries.YAxisType = ChartYAxisType.Secondary;

    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.
  10. Gary
    Gary avatar
    16 posts
    Member since:
    Oct 2012

    Posted 15 Sep 2010 Link to this post

    Hi

    Is it possible to produce a chart like the one attached using the Telerik chart control. Ie it has two Y axes measurements shown as the bars with a line showing the total of the two?

    If so could you show an eample of what code to use.

    Many thanks

    Gary 

  11. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 16 Sep 2010 Link to this post

    Hi Gary,

    Our suggestion is to create a Calculated Field to sum the fields in interest. Once you have that calculated field, you can use it in the chart series.

    Check out the attached sample report.

    All the best,
    Peter
    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
  12. Mike
    Mike avatar
    7 posts
    Member since:
    Sep 2015

    Posted 29 Jan in reply to Peter Link to this post

    Hi - I need to do the exact same thing as Peter's post suggest, but with a RadChartView control in a WinForms application.  I need to have a bar chart together with a line chart overlay, in such a way the line chart sits directly on top of the bar chart.

    I can find no recent examples.

    Michael

  13. Stef
    Admin
    Stef avatar
    3036 posts

    Posted 01 Feb Link to this post

    Hello Michael,

    Details how to create a Bar and Line charts with Telerik UI for WinForms are available in the following help articles:
    For more details, please use Telerik UI for WinForms forum or open a support ticket elaborating on the scenario and the issue.


    About Telerik Reporting, in a report the chart can be created via Graph item. An example can be found in How to: Create Graph with Column and Line Series.

    Regards,
    Stef
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner