I have a line chart with markers disabled. The legendSymbol is currently a line. I would like to show the symbol as a square. Any pointers?
标签:
highcharts
相关问题
- Issues using highcharts node export server from Cl
- Rails collecting and rendering JSON data in to a H
- Create highchart density with more than 2 groups
- Highcharts / Highstock step line without vertical
- Highcharts Synchronized charts display tooltip
相关文章
- Change color of bars depending on value in Highcha
- Changing Highcharts data series type dynamically
- Set highcharts y-axis min value to 0, unless there
- high chart sample
- Highchart's gauge with gradient plotband
- HighCharts pie chart X-axies values are not displa
- Why Highcharts gets different size on Safari?
- Ajax JSON in to Highcharts Pie Chart
You can use two series (one normal and one fake) with defined custom symbol. First should be hidden in legend. Then only what you need is use
legendItemClick
and call action.http://jsfiddle.net/5m9JW/339/
You can change the
stroke-width
attribute on the path element.We can provide functions to Highcharts that will be drawn whenever the chart is drawn. Since
redraw
is not called on the first drawing theload
event is neededI like this as it's quicker than than the other two answers and adding a "fake series" feels like a hack.
If you need further customization Hendrik's would be great! The original question asked for a square, if all that's really needed is a rectangle (or a large square) this works great.
Also Hendrik's answer didn't work for me out of the box in HighStocks, this does.
With the latest Highcharts release you can also exchange the method that draws the legend icon from outside of Highcharts:
To use the element that is drawn for the area chart as an icon for a line graph. (I have used this in Highcharts Stockcharts but this should be applicable in basic Highcharts as well)