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

Update README, documentation with Echarts v5.0 examples #36

Open
dvago opened this issue Jun 7, 2021 · 2 comments
Open

Update README, documentation with Echarts v5.0 examples #36

dvago opened this issue Jun 7, 2021 · 2 comments

Comments

@dvago
Copy link

dvago commented Jun 7, 2021

Hi there,

First of all, thanks for creating and maintaining this library.

This issue is to request the possibility to update the documentation.

It seems like registerTransform doesn't exists in the newer version of Echarts - see url: Echarts API search page

Also, could you please write down some example of how to import the single functionalities rather than importing the whole package?

e.g. (not sure it exists, so the below is just an example to help you understand my request)

import { histogram } from 'ecstat/transform'
@100pah
Copy link
Contributor

100pah commented Jun 10, 2021

@dvago

If using bundler (like webpack, rollup, etc.), for example:

npm install echarts-stat
npm install echarts
import * as echarts from 'echarts';
import {transform} from 'echarts-stat';

echarts.registerTransform(transform.histogram);

var myChart = echarts.init(document.getElementById('main0'));

var option = {
    dataset: [{
        source: [
            [8.3, 143], [8.6, 214], [8.8, 251], [10.5, 26], [10.7, 86], [10.8, 93], [11.0, 176], [11.0, 39], [11.1, 221], [11.2, 188], [11.3, 57], [11.4, 91], [11.4, 191], [11.7, 8], [12.0, 196], [12.9, 177], [12.9, 153], [13.3, 201], [13.7, 199], [13.8, 47], [14.0, 81], [14.2, 98], [14.5, 121], [16.0, 37], [16.3, 12], [17.3, 105], [17.5, 168], [17.9, 84], [18.0, 197], [18.0, 155], [20.6, 125]
        ]
    }, {
        transform: {
            type: 'ecStat:histogram'
        }
    }],
    tooltip: {
    },
    xAxis: {
        type: 'category',
        scale: true
    },
    yAxis: {},
    series: {
        name: 'histogram',
        type: 'bar',
        barWidth: '99.3%',
        label: {
            show: true,
            position: 'top'
        },
        datasetIndex: 1
    }
};

myChart.setOption(option);

@dvago
Copy link
Author

dvago commented Jun 14, 2021

Thanks @100pah,

As far as I can see the first import is the full library of echarts, using the bundlers I would tend to use partial modules and import them via import { use } from 'echarts/core'

So I believe along with the import {transform} from 'echarts-stat'; I should also import the method: registerTransform.

I saw you created a new issue on the main echarts library so perhaps it's something we need to wait and expect from the next release of echarts, am I correct?

Thanks again for your support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants