Comments (13)
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.
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.
but how to add dynamic data to tooltip? data can be there in dataset/json array.
from apexcharts.js.
tooltip: {
custom: function({ series, seriesIndex, dataPointIndex, w }) {
return "<div>" + series + "</div>";
}
},
from apexcharts.js.
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.
Sorry, I don't get your question correctly.
Can you please elaborate what are you trying to accomplish?
from apexcharts.js.
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
from apexcharts.js.
ok that would work. Is it possible to remove the series name?
from apexcharts.js.
Yes, but with CSS :)
Check the same example I just updated
from apexcharts.js.
Ok thanks
from apexcharts.js.
Thanks @junedchhipa for above.
from apexcharts.js.
`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.
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
from apexcharts.js.
Related Issues (20)
- Treemap chart is not showing data properly in Angular. HOT 1
- Wish to have yaxis 0 tick always showing, but forceNiceScale does not seem to work properly with min/max values -1 < value < 1 HOT 4
- Certain stacked bar doesn't stack but overlaid on another series HOT 1
- Add SSR Support
- Grid lines overlaps floating legend HOT 1
- seriesIndex and dataPointIndex set to -1 if tooltips disabled HOT 2
- Grid lines overlapping legends
- Upgrade to 3.46.0 leads to not taking into account tickAmount in xaxis HOT 1
- Deselecting all series in a rangeArea graph results in an error
- Event for toolbar zoomin and zoomout
- X-Axis type says that the library doesn't support functions for dynamically calculating min and max HOT 1
- Apply border radius for stacked bar chart only for last and first items
- Make the Annotation to the background of the series
- Show markers for each line on Hover in combined charts of rangeArea type
- Indicate position of the tooltip relative to cursor
- DataLabels misplaced when zooming and toolbar not showing when show=true
- Accessibility: Request to replace height and width html attributes with CSS on rect and foreignObject elements HOT 1
- Stepline chart - choose preferred line interpolation
- The border of the x-axis is misaligned in the Reversed Horizontal Bar Chart. HOT 1
- HeatMap Chart Not Support rgba / 8HEX To RGBA error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apexcharts.js.