Erdogan
Erdogan

Reputation: 1000

How to bind AmCharts (Stock Chart) to select all the datasets?

In my StockChart I want to select all datasets but it just binds the first dataset item (Anadolu YK).

How can I do to select others? (Avrupa YK) (Bursa) (Antalya) ..

JsFiddle Sample

 dataSets: [{
            title: "Anadolu YK",
            fieldMappings: [{
                fromField: "value",
                toField: "value"
            }, {
                fromField: "volume",
                toField: "volume"
            }],
            dataProvider: chartData1,
            categoryField: "date"
        },

          {
              title: "Avrupa YK",
              fieldMappings: [{
                  fromField: "value",
                  toField: "value"
              }, {
                  fromField: "volume",
                  toField: "volume"
              }],
              dataProvider: chartData2,
              categoryField: "date"
          },

Upvotes: 1

Views: 423

Answers (1)

martynasma
martynasma

Reputation: 8595

To make a Data Set pre-selected set its compared property to true:

{
  title: "Avrupa YK",
  fieldMappings: [ {
    fromField: "value",
    toField: "value"
  }, {
    fromField: "volume",
    toField: "volume"
  } ],
  dataProvider: chartData2,
  categoryField: "date",
  compared: true
}

Upvotes: 2

Related Questions