mnelson104
Posts: 5
Joined: Fri Nov 16, 2018 7:43 pm

How to use charts other than bar?

I was trying to display a line chart locally. I can get the demo bar chart to display but when i copy one of demo line charts from this site/jsfiddle site, it doesn’t display. Am I missing anything in the html or the JavaScript call? Thanks in advance for any help given,

Matthew Nelson
WhoAmI
Posts: 33
Joined: Tue Dec 01, 2015 1:22 pm

Re: How to use charts other than bar?

Hello Mr. Nelson,

You have to use

type: 'spline'

for displaying a line chart you have to use the above type
bastss
Site Admin
Posts: 1204
Joined: Wed Oct 17, 2018 10:59 am

Re: How to use charts other than bar?

Hello Matthew Nelson,

It is really easy to switch between types of charts. If you want to display your local working example as a line, all you need is to set chart.type property in your code to 'line'. API: https://www.highcharts.com/docs/chart-a ... hart-types. It is highly likely that you missed something or did something wrong during copying code to your local files from working demos. Try to analyze your code, check your console and compare your code with a code from working example. If you couldn't find what is wrong share your code and we will try to help :) Helpful documentation: https://www.highcharts.com/docs/getting ... stallation https://www.highcharts.com/docs/getting ... irst-chart

Kind regards!
Sebastian Wędzel,
Highcharts Developer
mnelson104
Posts: 5
Joined: Fri Nov 16, 2018 7:43 pm

Re: How to use charts other than bar?

bastss wrote: Mon Nov 19, 2018 10:42 am Hello Matthew Nelson,

It is really easy to switch between types of charts. If you want to display your local working example as a line, all you need is to set chart.type property in your code to 'line'. API: https://www.highcharts.com/docs/chart-a ... hart-types. It is highly likely that you missed something or did something wrong during copying code to your local files from working demos. Try to analyze your code, check your console and compare your code with a code from working example. If you couldn't find what is wrong share your code and we will try to help :) Helpful documentation: https://www.highcharts.com/docs/getting ... stallation https://www.highcharts.com/docs/getting ... irst-chart

Kind regards!
Thank you! I figured this out a few moments ago. The issue was found when i checked the console and realized the issue was with the $(function () { was not being closed correctly and sure enough when i added the extra } and ) it worked fine. thanks for your help!

Return to “Highcharts Usage”