Search code examples
primefacesjqplot

How to remove x-axis index from the tooltip/label


How to remove this value from bars (1,) I am using PrimeFaces and jqPlot would like to leave only the second value when hovering over the bar.

I already tried to search various information on the internet but found nothing exclusively about this customization. By the image below I better illustrate which value I want to remove from my bars in the chart.

https://ibb.co/8jSk4zP

function skinBarImpurezasMinerais() {
                this.cfg.shadow = false;
                this.cfg.title = '';
                //this.cfg.seriesColors = ['#e30910', '#FFC107'];
                this.cfg.grid = {
                    background: '#ffffff',
                    borderColor: '#ffffff',
                    gridLineColor: '#F5F5F5',
                    shadow: false
                };
                this.cfg.axesDefaults = {
                    borderWidth: 0.1,
                    borderColor: 'bdbdbd',
                    rendererOptions: {
                        textColor: '#666F77'
                    }
                };
                this.cfg.seriesDefaults = {
                    shadow: false,
                    lineWidth: 1,
                    stackSeries: true,
                    renderer: $.jqplot.BarRenderer,
                    pointLabels: {show: true},
                    rendererOptions: {
                        varyBarColor: true,
                        barWidth: 50,
                    },
                    markerOptions: {
                        shadow: false,
                        size: 7,
                        style: 'circle'
                    }
                }
            }

Thanks!


Solution

  • I found the solution .. I had to add the block below

    highlighter: { show: true, 
                showTooltip: true,      // show a tooltip with data point values.
                tooltipLocation: 'nw',  // location of tooltip: n, ne, e, se, s, sw, w, nw.
                tooltipAxes: 'y',    // which axis values to display in the tooltip, x, y or both.
                lineWidthAdjust: 2.5   // pixels to add to the size line stroking the data point marker
                }