This is a migrated thread and some comments may be shown as answers.

Combining bar & line in same chart

11 Answers 738 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sivam
Top achievements
Rank 1
Sivam asked on 28 Apr 2010, 05:58 AM
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

11 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 30 Apr 2010, 06:13 PM
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.
0
Sivam
Top achievements
Rank 1
answered on 05 May 2010, 08:33 AM
Thanks, i got.
I've another question. How can i make 3 combinations. See attached for sample. Need to know whether possible?
0
Ves
Telerik team
answered on 06 May 2010, 01:32 PM
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.
0
Sivam
Top achievements
Rank 1
answered on 06 May 2010, 04:00 PM
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?
0
Ves
Telerik team
answered on 11 May 2010, 01:24 PM
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.
0
Sivam
Top achievements
Rank 1
answered on 13 May 2010, 09:48 AM
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.
0
Accepted
Ves
Telerik team
answered on 14 May 2010, 01:24 PM
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.
0
Gary
Top achievements
Rank 1
answered on 15 Sep 2010, 09:51 AM
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 

0
Peter
Telerik team
answered on 16 Sep 2010, 02:42 PM
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
0
Mike
Top achievements
Rank 1
answered on 29 Jan 2016, 04:22 PM

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

0
Stef
Telerik team
answered on 01 Feb 2016, 12:24 PM
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
Tags
General Discussions
Asked by
Sivam
Top achievements
Rank 1
Answers by
Peter
Telerik team
Sivam
Top achievements
Rank 1
Ves
Telerik team
Gary
Top achievements
Rank 1
Mike
Top achievements
Rank 1
Stef
Telerik team
Share this question
or