官术网_书友最值得收藏!

  • Highcharts Essentials
  • Bilal Shahid
  • 210字
  • 2021-08-05 17:35:52

Including multiple data series

Since the previous chart only shows the total number of medals, it's not very helpful when looking for the numbers of gold, silver, or bronze medals earned by each country. We can modify the chart to show the individual numbers while retaining its simplicity.

Copy the code from the previous example and modify the code to include an array of multiple series:

series: [{
  name: 'Gold',
  data: [46, 38, 24, 29, 13]
}, {
  name: 'Silver',
  data: [29, 27, 26, 17, 8]
}, {
  name: 'Bronze',
  data: [29, 23, 32, 19, 7]
}]

This modification of code will result in a chart showing the number of gold, silver, and bronze medals for each country.

As mentioned earlier, you can always navigate to the Highcharts documentation to find more about the series component at http://api.highcharts.com/highcharts#series.

You can toggle the display of each series by clicking on the legend corresponding to each category at the bottom of the chart.

In this example, we included multiple series in a single chart to show a more simplified form of data. In the next example, we will stack these multiple series in a single column to show the difference in ratios between each category as well as visualize their total values.

主站蜘蛛池模板: 平昌县| 扶余县| 五华县| 牙克石市| 灵璧县| 保康县| 电白县| 南丹县| 贵港市| 隆安县| 海晏县| 星座| 开封县| 红原县| 恩施市| 鹤岗市| 石棉县| 保定市| 泸西县| 台山市| 广元市| 达孜县| 荥阳市| 麻阳| 荆门市| 镇安县| 绍兴县| 永仁县| 临猗县| 大渡口区| 苍山县| 宿州市| 亳州市| 嘉鱼县| 元阳县| 汽车| 河津市| 五莲县| 梅州市| 新建县| 仙居县|