Giter Club home page Giter Club logo

Comments (9)

krisklosterman avatar krisklosterman commented on May 22, 2024

any ideas
@xieziyu

from ngx-echarts.

xieziyu avatar xieziyu commented on May 22, 2024

@krisklosterman Sorry for the late response, I think you need to ask echarts team about this question.

from ngx-echarts.

krisklosterman avatar krisklosterman commented on May 22, 2024

echarts team does not have an dataset attribute that is angular bound?

from ngx-echarts.

xieziyu avatar xieziyu commented on May 22, 2024

Just forget about dataset, you can directly set data in options just like the echarts official demo.

from ngx-echarts.

krisklosterman avatar krisklosterman commented on May 22, 2024

I am using [dataset] to bind an angular variable to the chart. I update that variable and it shows up in the chart.

<div echarts [options]="graphOptions" [dataset]="blxAPI.graph_stats" class="echart"></div>

in the code I update blxAPI.graph_stats as new data comes in with an array of

{ name: DateValueHere, value: [DateValueHere, FloatHere]}

the options variable I use

this.graphOptions = {
      title: {
        text: 'Graph Stats Chart Test'
      },
    legend: {
      data:['Graph Stats']
    },
    "grid": {
      "bottom": 80
    },
    "toolbox": {
      feature: {
          dataZoom: {
              yAxisIndex: 'none'
          }
      }
    },
    "dataZoom": [
      {
        "show": true,
        "realtime": true,
        "start": 65,
        "end": 100
      }
    ],
      xAxis: {
          type : 'time',
      },
      yAxis: {
          type : 'value'
      },
      series : [
        {
          name: 'Graph Stats',
          type: 'line'
        }
      ]
    };

  }

from ngx-echarts.

xieziyu avatar xieziyu commented on May 22, 2024

[dataset] is actually putting your data into series for you.
So try to not use dataset and update your graphOptions whenever blxAPI.graph_stats changes just like below:

// call updateStats where you update blxAPI.graph_stats
updateStats() {
  this.graphOptions = {
    title: {
      text: 'Graph Stats Chart Test'
    },
    legend: {
      data: ['Graph Stats']
    },
    "grid": {
      "bottom": 80
    },
    "toolbox": {
      feature: {
        dataZoom: {
          yAxisIndex: 'none'
        }
      }
    },
    "dataZoom": [
      {
        "show": true,
        "realtime": true,
        "start": 65,
        "end": 100
      }
    ],
    xAxis: {
      type: 'time',
    },
    yAxis: {
      type: 'value'
    },
    series: [
      {
        name: 'Graph Stats',
        type: 'line',
        // here is your data
        data: blxAPI.graph_stats
      }
    ]
  };
}

If you still have the same issue, please ask echarts team for help.

from ngx-echarts.

krisklosterman avatar krisklosterman commented on May 22, 2024

ok thanks

from ngx-echarts.

krisklosterman avatar krisklosterman commented on May 22, 2024

I've copied static examples out of the echarts website and datazoom does not work.

If anyone actualy has datazoom working with NGX-ECHARTS, please let me know, but I think is broke or not functional.

from ngx-echarts.

sauliuni avatar sauliuni commented on May 22, 2024

well i used e.g.
dataZoom: [ { type: 'inside', start: 50, end: 100 }, { show: true, type: 'slider', y: '90%', start: 50, end: 100 } ],

on my data, and it worked

from ngx-echarts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.