igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

How can I enable tooltips for an igx-data-chart with a category X-axis and line series?

Open Vighneshaa opened this issue 1 year ago • 4 comments

I am using an igx-data-chart with a line series and a category X-axis. I would like to know if it's possible to display the tooltip, as shown in the screenshot, for this configuration. Specifically, I am looking for tooltip functionality similar to what is available for the igx-data-chart with a category X-axis and line series.

image

The code snippet is shown below:- `<igx-data-chart domChange (onInit)="loadAxes(chart)" [crosshairVisibility]="crosshairVisibility" #chart height="100%" width="100%" [legend]="legend" [defaultInteraction]="defaultInteraction" [brushes]="brushColor" [isHorizontalZoomEnabled]="false" [isVerticalZoomEnabled]="false" [dataSource]="chartData" highlightingMode="FadeOthersSpecific" (plotAreaMouseLeftButtonDown)="chart_plotAreaMouseLeftButtonDown" (seriesMouseLeftButtonDown)="chart_seriesMouseLeftButtonDown($event)" highlightingBehavior="NearestItemsAndSeries">

                <igx-category-x-axis useClusteringMode="true" #xAxis [label]="xAxisLabel" overlap="0" gap="0.1">
                </igx-category-x-axis>

                <!-- (onInit)="seriesOnInit(lineSeries)" -->
                <igx-line-series [unknownValuePlotting]="unknownValuePlotting" #lineSeries
                    *ngFor="let axis of lineSeries" [xAxis]="xAxis" [yAxis]="yAxes[axis.template]"
                    [brush]="axis.lineColor" hitTestMode="ColorEncoded"
                    [markerType]="'None'" [valueMemberPath]="axis.title" [title]="axis.title" domChange
                    [thickness]="defaultThickness" showDefaultTooltip="true"
                    [isHighlightingEnabled]="true">
                </igx-line-series>
                
                <igx-data-tool-tip-layer></igx-data-tool-tip-layer>

                <!-- <igx-crosshair-layer brush="gray"></igx-crosshair-layer> -->

                <!-- <igx-final-value-layer></igx-final-value-layer> -->

            </igx-data-chart>`

Vighneshaa avatar Sep 18 '24 10:09 Vighneshaa

Hello and thank you for reaching out. The sample above has showDefaultTooltip set to false because it's using the DataTooltipLayer.

eg. https://codesandbox.io/p/devbox/busy-turing-sekw0r

After toggling showDefaultTooltip to false, if you are still having issues please make sure similar modules are loaded, especially the IgxDataChartInteractivityModule

see app.module.ts in the sample above. Let me know if you have any questions.

mddifilippo89 avatar Sep 19 '24 16:09 mddifilippo89

@mddifilippo89 Hello I tried out the solution you suggested and it is not working. Also, I have added the module IgxDataChartInteractivityModule in module.ts file

image

Vighneshaa avatar Sep 20 '24 09:09 Vighneshaa

@mddifilippo89 Any updates?

Vighneshaa avatar Sep 23 '24 13:09 Vighneshaa

@Vighneshaa I will require a sample from you to investigate this further.

mddifilippo89 avatar Sep 26 '24 18:09 mddifilippo89

@mddifilippo89 The file attached below is the sample file:-

https://equitydatascience-my.sharepoint.com/:u:/p/vighnesha/EVQgoIDbqs1AhQnFHE41DVUBM4fmZbuC43NiYIf3vgEXdA?e=I7gOiW

Vighneshaa avatar Nov 05 '24 09:11 Vighneshaa

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Jan 05 '25 00:01 github-actions[bot]