Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linear , Polynomial series plotting #44

Open
RavalikaP opened this issue Feb 9, 2022 · 0 comments
Open

Linear , Polynomial series plotting #44

RavalikaP opened this issue Feb 9, 2022 · 0 comments

Comments

@RavalikaP
Copy link

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);

@ecomfe ecomfe deleted a comment from echodis Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant