score:1
Accepted answer
you will need to watch for changes to the selected chart type. i suggest something like:
var charttype = "line";
$("#charttype").change(function() {
charttype = $("#charttype option:selected").val();
});
you can now refer to the variable charttype in your chart code.
chart.addseries({
name: '#active leaners',
type: charttype,
color: '#43cd80',
data:[100, 200, 300, 400, 100, 200, 100,200,300,100,400,100]
to make your job simpler, i suggest putting the code which draws the chart into a function. you can then call this function whenever any of the selections/inputs changes. something like:
var charttype = "line";
var seriestype = "a";
$("#charttype").change(function() {
charttype = $("#charttype option:selected").val();
redrawchart();
});
$(".test").change(function() {
seriestype = this.getattribute("value");
redrawchart();
}
score:2
you can simply update series.types using series.update()
. see: http://jsfiddle.net/zuxdg/
$("#charttype").change(function() {
var type = this.value;
if(type !== '0') {
$(chart.series).each(function(){
this.update({
type: type
}, false);
});
chart.redraw();
}
});
Source: stackoverflow.com
Related Query
- highcharts change chart type using dropdown for multiple series
- Change chart type and redraw with multiple series in Highcharts
- highcharts - chart names for multiple pie chart series in one chart
- jQuery Highcharts: change chart type using dropdown list
- Strange behavior with highcharts when using "column" type and multiple datetime series
- Highcharts display label for pie chart using html table as data source
- Basic Highcharts Multiple Series Chart Using JSON
- How to change the data series for highchart using a dropdown list
- Highcharts : using same div to load a chart multiple times with different series data
- Using highcharts x-axis "zones" for datetime series chart
- Add a dropdown to Highcharts to change chart type with AngularJs
- highcharts jquery dynamic change chart type column to bar
- HighCharts Dynamically Change Chart Type
- Highcharts Custom tooltips for multiple series
- Using HighCharts and DotNet.HighCharts to "Play" Multiple Series
- Highcharts, Can you change the chart type for drilldowns?
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Highcharts not displaying series data for graph with multiple Y-axes
- Rails generates chart for .each do |x| using highcharts or any other chart API
- Timeline chart with highcharts using x-range with multiple stacks
- Highcharts, how to change hover bg color for series with multiple columns (categories)
- Highcharts problem with xAxis using multiple series
- Passing in Id for each data item in bar chart using highcharts
- Change chart type with drilldown series
- Highcharts change label text for a single series
- Highcharts - In area chart how to use gradient color for multiple series?
- How to use Highcharts React to create chart with multiple lines for same XAxis?
- Is there a way to change the display value in series using highcharts
- Change color of series onclick events across multiple highcharts
- Highcharts cannot reload multiple series chart
More Query from same tag
- Click event on clicking on the graph
- Rails generates chart for .each do |x| using highcharts or any other chart API
- iOS Swift Highcharts Pie with Gradient Fill is black
- Border on selected series in Stacked Bar charts + High Charts
- Margin in chart with x, y data series
- Getting error when using angular2-highcharts in angular2 project
- Extend line until new value occurs
- Sharing variable between functions
- Highcharts not displaying data labels for Pie chart in arabic
- Network chart nodes relation nodes merging -> highcharts
- Highcharts pie charts can have url links
- Separate panes / or style maximum gridlines in Highstock
- Can another column name than "value" be used in Highmaps?
- Snap to month in highchart stock navigator
- Highcharts simple column chart: data not showing
- Highcharts: Stacked Column increase borderWidth on select state
- How to push data into highchart with just one decimal place?
- Highcharts: yAxis.height does not scale drawable area, causing graph to go off the chart
- Highcharts switching off animation for column chart
- High Charts tooltip
- Highcharts - labels inside and outside a pie chart
- how create chart with highcharts.js and call ajax?
- Setting custom colors in Highcharts drill-down maps
- scrollbar is not initially visible in highstock
- Highchart boxplot zones use median instead of high as threshold
- Highchart data labels appear in middle if xAxis ticks
- JS Centre-Zeroed Gauge Chart
- highcharts.js column/bar overlap (datetime Xaxis)
- R highcharter - adding total in tooltip
- Angular highcharts treemap squarified fit tiles