Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
Non-monotonic line chart

I've created a linechart in ExtJS but came accross an obstacle. I want to create a line chart that doesn't go to each next point in a Monotonic fashion. Let's say I have the following dataset:

let testData = [{
        price: 500,
        date: '01-01-2021'
    }, {
        price: 200,
        date: '01-02-2021'
    }, {
        price: 1000,
        date: '02-09-2021'
    }];

When using this data in an ExtJS linechart it will create a diagonal line between the price of 200 and 1000, this data representation is incorrect since the price did not gradually rise in this time.

My question is: How can I achieve this using ExtJS charts?

Check the visual examples for the current and desirable result.

Please let me know if you need any extra information.

Monotonic (current result): Monotonic linechart

Non-monotonic (Desirable result) Non-monotonic

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Have you tried curve property?

enter image description here

Ext.create({
    xtype: 'cartesian',

    renderTo: Ext.getBody(),
    width: 600,
    height: 400,
    insetPadding: 40,

    legend: {
        docked: 'bottom',
    },

    store: {
        fields: ['name', 'data1', 'data2'],

        data: [{
            'name': 'metric one',
            'data1': 10,
            'data2': 14
        }, {
            'name': 'metric two',
            'data1': 7,
            'data2': 16
        }, {
            'name': 'metric three',
            'data1': 5,
            'data2': 14
        }, {
            'name': 'metric four',
            'data1': 2,
            'data2': 6
        }, {
            'name': 'metric five',
            'data1': 27,
            'data2': 36
        }]
    },

    axes: [{
        type: 'numeric',
        position: 'left',
        fields: ['data1'],
        grid: true,
        minimum: 0
    }, {
        type: 'category',
        position: 'bottom',
        fields: ['name'],

    }],

    colors: ['#ffff00', '#00ffff'],

    series: [{
        type: 'line',
        xField: 'name',
        yField: 'data1',
        curve: {
            type: 'step-after'
        }
    }, {
        type: 'line',
        fill: false,
        xField: 'name',
        yField: 'data2',

    }]
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!