Skip to content

Xaxis "max" value is ignored when also providing a "stepSize" #5082

@toba-pl

Description

@toba-pl

Description

Create a bubble chart with a XAxis which sets both the "max" value and "stepSize". E.g. with this setup:

JS Code
function generateData(basetime, count, yrange) {
  var i = 0
  var series = []

  while (i < count) {
    var x = Math.floor(Math.random() * (750 - 1 + 1)) + 1
    var y =
      Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min
    var z = Math.floor(Math.random() * (75 - 15 + 1)) + 15 // bubble size

    series.push([x, y, z])
    i++
  }

  return series
}

var options = {
  series: [
    {
      name: 'Bubble1',
      data: generateData(new Date('11 Feb 2017 GMT').getTime(), 20, {
        min: 10,
        max: 60,
      }),
    },
    {
      name: 'Bubble2',
      data: generateData(new Date('11 Feb 2017 GMT').getTime(), 20, {
        min: 10,
        max: 60,
      }),
    },
    {
      name: 'Bubble3',
      data: generateData(new Date('11 Feb 2017 GMT').getTime(), 20, {
        min: 10,
        max: 60,
      }),
    },
    {
      name: 'Bubble4',
      data: generateData(new Date('11 Feb 2017 GMT').getTime(), 20, {
        min: 10,
        max: 60,
      }),
    },
  ],
  chart: {
    height: 350,
    type: 'bubble',
  },
  dataLabels: {
    enabled: false,
  },
  fill: {
    opacity: 0.8,
  },
  title: {
    text: 'Simple Bubble Chart',
  },
  xaxis: {
    max: 200,
    stepSize: 50,
    min: 0,
    type: 'double',
  },
  yaxis: {
    max: 70,
  },
}

var chart = new ApexCharts(document.querySelector('#chart'), options)
chart.render()

Possibly related issue i found: #4670

Steps to Reproduce

  1. Create the buble chart with some example data
  2. Set axis "max" and "stepSize" properties (e.g. 50 and 200)
  3. See that max value is ignored in that case

Expected Behavior

The "max" value should still apply even if the "stepSize" is set as well.

Actual Behavior

The "max" value is completly ignored with the "stepSize" options set.

Screenshots

This chart has "max" on XAxis set to 200:

Image

Reproduction Link

https://codepen.io/neurotoxin41241/pen/raOegBL

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions