amcharts / amcharts4

The most advanced amCharts charting library for JavaScript and TypeScript apps.
https://www.amcharts.com/
1.16k stars 322 forks source link

I want to Show Only One Balloon Text in Stack Column amchart 4 #4193

Closed wajihasiddiquidanat closed 1 year ago

wajihasiddiquidanat commented 1 year ago

Screenshot (98) Screenshot (99)

createSeries(seriesVal1, seriesVal3); createSeries(seriesVal2, seriesVal4); function createSeries(field, name, Total) { var series = chart.series.push(new am4charts.ColumnSeries()); series.name = name; series.dataFields.valueY = field; series.dataFields.dateX = "D"; series.dataFields.categoryX = "FPT"; if (DivID == 'TotalpersonalloansCCM') { series.dataFields.categoryY = "SumValues3"; } else { series.dataFields.categoryY = "SumValues2"; } series.sequencedInterpolation = true; series.stacked = true; series.text = "Total"; series.columns.template.tooltipText = "[bold]{text}: {categoryY.formatNumber('0.00')} [/]\n[font-size:14px]{categoryX}"; series.tooltip.getFillFromObject = false; series.tooltip.label.propertyFields.fill = "#000000"; series.tooltip.label.textAlign = "middle"; series.tooltip.pointerOrientation = "down"; series.tooltip.background.propertyFields.stroke = "#000000"; series.tooltip.background.fill = am4core.color("#000000"); series.columns.template.tooltipY = 0; return series;

        }

here is My Code

martynasma commented 1 year ago

Are you also using XYCursor? If the answer is yes, then please refer to this tutorial: https://www.amcharts.com/docs/v4/concepts/chart-cursor/#Limiting_number_of_series_tooltips

wajihasiddiquidanat commented 1 year ago

no, i,m not using XYCursor

martynasma commented 1 year ago

In that case, I'm not entirely sure I understand the question. You should already be seeing just one balloon when hovering the columns.

wajihasiddiquidanat commented 1 year ago

the chart shows two balloons one for seriesVal1 and one for seriesVa2 I want only one ballon on top of the column. when I hover to the orange part the balloon show on the orange part of the column and when I hover to the yellow part the balloon show on the yellow part of the column.

martynasma commented 1 year ago

Gotcha.

I suppose you can do it this way:

1) Add an XYCursor. 2) Add tooltipText to the topmost series only.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.