madec-project / ezvis

A dashboard to visualize a synthesis on a structured corpus, using several charts (pies, histograms, ...)
https://ezvis.readthedocs.org/
17 stars 5 forks source link

Bubble chart with symbolic abscissa #15

Closed parmentf closed 9 years ago

parmentf commented 9 years ago

http://www.amcharts.com/demos/bubble-chart/

Look if it's possible.

parmentf commented 9 years ago

I tried a normal bubble chart:

    var options = {
      type: "xy",
      pathToImages : "assets/amcharts/images/",
      theme : "none",
      dataProvider: [{
        x: 1,
        y: 1,
        value: 1
      }, {
        x: 2,
        y: 1,
        value: 2
      }],
      graphs: [{
        bullet: "circle",
        valueField: "value",
        xField: "x",
        yField: "y",
        maxBulletSize: 100,
        minBulletSize: 50
      }]
    };
    $('#' + id).height('600px');
    var chart = AmCharts.makeChart("#" + id, options);
    chart.write(id);

which worked.

But, replacing x numerical values with symbolic ones did not:

    var options = {
      type: "xy",
      pathToImages : "assets/amcharts/images/",
      theme : "none",
      dataProvider: [{
        x: "A",
        y: 1,
        value: 1
      }, {
        x: "B",
        y: 1,
        value: 2
      }],
      graphs: [{
        bullet: "circle",
        valueField: "value",
        xField: "x",
        yField: "y",
        maxBulletSize: 100,
        minBulletSize: 50
      }]
    };
    $('#' + id).height('600px');
    var chart = AmCharts.makeChart("#" + id, options);
    chart.write(id);

The chart is empty (no labels on x abscissa).