Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
30
igDataChart with two dimensional legend
posted

I want to create a scatter data chart with two dimensional legend.

For Edit fiddle - JSFiddle - Code Playground it will generate with single dimensional like below

For the custom data

[{
    Country: "US",
    Element: "A",
    Population: 197,
    Population_Unit: "1,000,000 People",
    Value: 94323,
    Value_Unit: "1,000,000 Int. $",
    Year: 1964
  }, {
    Country: "US",
    Element: "A",
    Population: 194,
    Population_Unit: "1,000,000 People",
    Value: 93700,
    Value_Unit: "1,000,000 Int. $",
    Year: 1963
  }, {
    Country: "USA",
    Element: "B",
    Population: 191,
    Population_Unit: "1,000,000 People",
    Value: 90275,
    Value_Unit: "1,000,000 Int. $",
    Year: 1962
  }, {
    Country: "USA",
    Element: "A",
    Population: 189,
    Population_Unit: "1,000,000 People",
    Value: 89816,
    Value_Unit: "1,000,000 Int. $",
    Year: 1961
  }]

How to custom the legend to achieve it based on Country & ElementA to show like below which show as table:

Its result show Country  as first column and show Element as first row and then draw different graph for different county and different color for different Element.