user1595929
user1595929

Reputation: 1372

Set different pointPadding with highcharts

I would like to emphasise the difference between 2 different series in the same graphic : one coming from the user data and one from static data as following : enter image description here

I wanted to define the pointPadding value, but this is available for all the series. How can I set this value only for a specific serie ?

Upvotes: 0

Views: 30

Answers (1)

ppotaczek
ppotaczek

Reputation: 39069

The simplest solution seems to be adding a second x-axis and separate series. For example:

  series: [{
    ...,
    groupPadding: 0.325,
    id: 'id1'
  }, {
    ...,
    groupPadding: 0.325,
    id: 'id2'
  }, {
    ...,
    xAxis: 1,
    linkedTo: 'id1'
  }, {
    ...,
    xAxis: 1,
    linkedTo: 'id2'
  }],
  xAxis: [{
    width: '20%',
    type: 'category',
    tickWidth: 1
  }, {
    offset: 0,
    width: '80%',
    left: '20%',
    type: 'category',
    tickWidth: 1
  }]

Live demo: http://jsfiddle.net/BlackLabel/rwg6tL2v/

API Reference: https://api.highcharts.com/highcharts/xAxis

Upvotes: 1

Related Questions