Skip to content

Linear , Polynomial series plotting #44

Open
@RavalikaP

Description

@RavalikaP

I want to plot a line chart with one Linear/Polynomial line series. But there is no proper documentation for using one Category axis.

import * as echarts from 'echarts';

import ecStat from 'echarts-stat';

var chartDom = document.getElementById('main');
var myChart = echarts.init(chartDom);
var option;

// See https://github.com/ecomfe/echarts-stat
echarts.registerTransform(ecStat.transform.regression);
const data = [
{ name: 'Mon', value: 150 },
{ name: 'Tue', value: 230 },
{ name: 'Wed', value: 224 },
{ name: 'Thu', value: 218 },
{ name: 'Fri', value: 135 },
{ name: 'Sat', value: 147 },
{ name: 'Sun', value: 260 }
];
option = {
dataset: [
{
source: data
},
{
transform: {
type: 'ecStat:regression'
}
}
],
xAxis: {
type: 'category'
},
yAxis: {
type: 'value'
},
series: [
{
type: 'scatter'
},
{
name: 'line',
type: 'line',
datasetIndex: 1,
symbolSize: 0.1,
symbol: 'circle',
label: { show: true, fontSize: 16 },
labelLayout: { dx: -20 },
encode: { label: 2, tooltip: 1 }
}
]
};

option && myChart.setOption(option);

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