Giter Site home page Giter Site logo

Comments (13)

junedchhipa avatar junedchhipa commented on April 30, 2024 18

You can use label formatters to modify the text instead of displaying the default one.
See the example

You will need to set

tooltip: {
  y: {
    formatter: function(value) {
      return value + "your text";
    }
  }
}

from apexcharts.js.

junedchhipa avatar junedchhipa commented on April 30, 2024 7

I forgot that you can also do it without CSS display:none using tooltip.y.title.formatter function :)

tooltip: {
    y: {
      formatter: function(val) {
        return val + ".00" + " Rs"
      },
      title: {
        formatter: function (seriesName) {
          return ''
        }
      }
    }
  },

from apexcharts.js.

anilreddy128 avatar anilreddy128 commented on April 30, 2024 7

but how to add dynamic data to tooltip? data can be there in dataset/json array.

from apexcharts.js.

nuvenn avatar nuvenn commented on April 30, 2024 3
tooltip: {
      custom: function({ series, seriesIndex, dataPointIndex, w }) {
        return "<div>" + series + "</div>";
      }
 },

from apexcharts.js.

juanccamachob94 avatar juanccamachob94 commented on April 30, 2024 2

I forgot that you can also do it without CSS display:none using tooltip.y.title.formatter function :)

tooltip: {
    y: {
      formatter: function(val) {
        return val + ".00" + " Rs"
      },
      title: {
        formatter: function (seriesName) {
          return ''
        }
      }
    }
  },

It works to items of tooltip. I would like to change the tooltip title. I managed to do it, following the pattern of your code. Thank you very much

x: { formatter: function(x){ x + "changed" } }

from apexcharts.js.

junedchhipa avatar junedchhipa commented on April 30, 2024

Sorry, I don't get your question correctly.
Can you please elaborate what are you trying to accomplish?

from apexcharts.js.

felixalguzman avatar felixalguzman commented on April 30, 2024

I want to display some text instead of the default that is series. For each value in donut chart I have a text that i want to present as a tooltip

Something like this
image

from apexcharts.js.

felixalguzman avatar felixalguzman commented on April 30, 2024

ok that would work. Is it possible to remove the series name?

from apexcharts.js.

junedchhipa avatar junedchhipa commented on April 30, 2024

Yes, but with CSS :)
Check the same example I just updated

from apexcharts.js.

felixalguzman avatar felixalguzman commented on April 30, 2024

Ok thanks

from apexcharts.js.

DebasisBehera123 avatar DebasisBehera123 commented on April 30, 2024

Thanks @junedchhipa for above.

from apexcharts.js.

devinnogenio2 avatar devinnogenio2 commented on April 30, 2024
`const options = {
        cutout: "75%",
        borderWidth: 0,
        responsive: true,
        onHover: (event, chartElement) => {
          const target = event.native ? event.native.target : event.target;
          target.style.cursor = chartElement[0] ? "pointer" : "default";
        },
        plugins: {
          legend: {
            position: "bottom",
            labels: {
              usePointStyle: true,
              pointStyle: "circle",
            },
          },
          tooltip: {
            y: {
              formatter: function (value) {
                return value + "%";
              },
            },
          },
        },
      };`

I added options like this but it's not working

from apexcharts.js.

xyresicdarshan avatar xyresicdarshan commented on April 30, 2024

Hey,
I'm using Apexchart (StackedBarChart), I want to append the % sign in the hover value.

code is like this :
this.CategorySummaryChart = {
series: [{
name: "Completed",
data: this.completedQuestionsPercentage,
},
{
name: "NA",
data: this.naQuestionsPercentage,
},
{
name: "Overdue",
data: this.missedQuestionsPercentage,
},
],
chart: {
type: "bar",
height: 350,
stacked: true,
stackType: "100%",
width: '98%',
toolbar: {
show: false,
},
},
tooltip: {
y: {
formatter: function (value) {
return value + "%";
},
},
},
/* plotOptions: {
bar: {
columnWidth: '20',
},
}, */
responsive: [{
breakpoint: 900,
options: {
chart: {
type: "bar",
height: 350,
},
},
},],
xaxis: {
categories: this.categoryNames,
},
fill: {
opacity: 1,
},
legend: {
show: false,
position: "top",
offsetX: -20,
offsetY: 10,
horizontalAlign: 'right',
markers: {
radius: 12,
offsetY: 1,
},
onItemClick: {
toggleDataSeries: false,
},
onItemHover: {
highlightDataSeries: false
},
},
colors: this.colors,
};
}

Expected Ouput - something like this
Screenshot (41)

from apexcharts.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.