简体   繁体   中英

Highcharts - bar chart using triangles instead of bars

I'm trying to create a chart in highcharts that is like a bar chart but uses triangles instead of rectangle bars (ie the longer the triangle the bigger the value it represents).

I have managed to hack something using an area chart and plotting 3 points per triangle (0 for the base of the triangle and the actual value for the peak)

See http://jsfiddle.net/83jXA/2/

chart: { type: 'area' },
series: [{
        name: '2010',
        data: [0, 3, 0, null, null, null, null],           
    }, {
        name: '2011',
        data: [null, null, null, null, 0, 6, 0],
    }],

However, I was wondering if something closer to what I need exists so I don't have to plot these fake 0 and null values. I haven't managed to find anything in the docs.

What you have done is the only way to get a triangular bar charts. I have used a similar technique for bar chart where I wanted the bars to look a particular way, and it worked fine.

I was worried about performance, but we had no problems, even though the chart updates several times per second.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM