Skip to content Skip to sidebar Skip to footer

Unable Add Valueaxis Property To Amchart Stock Graph

I'm trying to add title to the first graph in a multiple stock graphs list. But it doesn't show up. Here is the code: stockGraphs: [{ id: 'g1', valueField:

Solution 1:

As indicated in the documentation, the valueAxis property takes an id or a reference to the valueAxis object. You're trying to assign an array, which is way off.

You need to add an id to the valueAxes array inside your panel in your demo, then set the valueAxis property to the id as a string:

valueAxes: [
    {
      id:"t1",
      title:"t1",
      maximum:3000
    },{
      id:"t2",
      title:"t1",
      position:"right",
      maximum:3000
    }
  ],stockGraphs: [
    {
      id:"g1",
      valueField:"value",
      comparable:true,
      bullet:"round",
      valueAxis:"t1"
    },{
      id:"g2",
      valueField:"value2dataset1",
      comparable:true,
      bullet:"round",
      valueAxis:"t2"
    }
  ],

Demo

I added a second value axis as assigning a value axis to a graph only helps if you need to display multiple value axes in a panel as all graphs will use the first value axis by default if it is not assigned.

Post a Comment for "Unable Add Valueaxis Property To Amchart Stock Graph"