Skip to content

Feature: Allow blank axis labels #15

@cnewtonMYCM

Description

@cnewtonMYCM

The Context

We have a Chart with the following setup below.

var chart = JSC.chart('chartDiv', {
  debug: true,
  type: 'area',
  legend_visible: false,
  series: [
    {
      type: 'line',
      points: [
        ['January', 29.9],
        [' ', 71.5],
        ['March', 106.4],
        ['April', 129.2],
        ['May', 144.0],
        ['June', 176.0],
        [' ', 36.3]
      ]
    }
  ]
});

It has empty spaces for the labels where "February" and "July" would've been.

The Problem

The Chart doesn't account well for these empty spaces because the last data point is pulled back to where February would've been because it treats the empty space labels as the same data point.
image

Setting the label to false or null doesn't fix this.

Adding an extra space so the last data point's label becomes two spaces ' ' is an unideal solution because, when the Chart is squished, it'll overwrite other labels that actually have text - labels that have text should always be preferred over blank labels.

The Feature Request

  • Allow for blank axis labels that do not get pulled back to previous points (always plot them onto the next point)
  • Ensure these blank labels do not overwrite other labels that actually have text when the Chart is squished down.

Why would we want this feature?

Charts with lots of data points can become confusing to look at. Allowing for data points with y=0 to have blank labels would add clarity.

Please let me know if you need any more information.
Thank you for your time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions