amcharts / amcharts5

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

ValueAxis tooltip position #1687

Closed prackode closed 1 month ago

prackode commented 2 months ago

I need to hide the valueaxis and its tooltip to be aligned right.

 var valueAxis = mainPanel.yAxes.push(
    am5xy.ValueAxis.new(instance, {
      renderer: am5xy.AxisRendererY.new(instance, {
        opposite: true
      }),
      extraMin: 0.1,
      extraTooltipPrecision: 2,
      tooltip: am5.Tooltip.new(instance, {}),
      numberFormat: "#,###.00",
      // visible: false
    })
  );

image

visible: false image

Is there any alternative to show tooltip on the right other than opposite: true ?

martynasma commented 2 months ago

Just use inside: true instead, and hide only labels:

var valueAxis = mainPanel.yAxes.push(
  am5xy.ValueAxis.new(instance, {
    renderer: am5xy.AxisRendererY.new(instance, {
      inside: true
    }),
    extraMin: 0.1,
    extraTooltipPrecision: 2,
    tooltip: am5.Tooltip.new(instance, {}),
    numberFormat: "#,###.00"
  })
);

valueAxis.get("renderer").labels.template.set("forceHidden", true);
github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. It will be closed in 5 days unless a new comment is added.