amcharts / amcharts5

The newest, fastest, and most advanced amCharts charting library for JavaScript and TypeScript apps.
Other
353 stars 95 forks source link

yAxis #1134

Closed mohammadhasananisi closed 1 year ago

mohammadhasananisi commented 1 year ago

Hi, Thank you for your great library.

when i use height in the yAxis this happens

https://github.com/amcharts/amcharts5/assets/47121464/e5f4136e-d26c-493b-ac22-7f2293b7eb97

can you fix that?

martynasma commented 1 year ago

Why would you set height on an axis and not on the panel?

mohammadhasananisi commented 1 year ago
// Create value axis
yAxis = mainPanel.yAxes.push(
  am5xy.ValueAxis.new(root, {
    renderer: am5xy.AxisRendererY.new(root, {
      pan: "zoom",
      inversed: false,
      inside: false,
      minGridDistance: 30,

      labels: {
        adapter: am5.Tooltip.new(root, {
          getStrokeFromSprite: true,
          getFillFromSprite: true,
        }),
        location: 1.3,
      },

      // height: am5.percent(70),

    }),
    // strictMinMaxSelection: true,
    extraMin: 0.37, // adds some space for for main series
    extraMax: 0,
    tooltip: am5.Tooltip.new(root, {}),
    extraTooltipPrecision: 1,
    numberFormat: "#.##a",
    logarithmic: true,
    maxPrecision: 0,
    position: 'relative',

    // height: am5.percent(70),
    // 
  })
);

this is my axis

mohammadhasananisi commented 1 year ago
  // Create a main stock panel (chart)
    mainPanel = stockChart.panels.push(

      am5stock.StockPanel.new(root, {
        wheelY: "zoomX",
        panX: true,
        panY: true,
        height: am5.percent(70),
      })
    );

this is my panel

mohammadhasananisi commented 1 year ago

I have a line chart in the stock chart button. That's why I need to use height

martynasma commented 1 year ago

I'm afraid I'm not quite sure what "I have a line chart in the stock chart button." means.

Would you be able to post your working chart on CodePen?