-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(core): title string contains html ascii characters #547
fix(core): title string contains html ascii characters #547
Conversation
Deploy preview for carbon-charts-react ready! Built with commit 3007a84 |
Deploy preview for carbon-charts-vue ready! Built with commit 3007a84 |
Deploy preview for carbon-charts-angular ready! Built with commit 3007a84 https://deploy-preview-547--carbon-charts-angular.netlify.com |
.append("tspan") | ||
.text("..."); | ||
|
||
// add events for displaying the tooltip with the title | ||
const self = this; | ||
title | ||
.on("mouseenter", function() { | ||
.on("mouseenter", function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.on("mouseenter", function () { | |
.on("mouseenter", function() { |
self.services.events.dispatchEvent("show-tooltip", { | ||
hoveredElement: title, | ||
type: TooltipTypes.TITLE | ||
}); | ||
}) | ||
.on("mouseout", function() { | ||
.on("mouseout", function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.on("mouseout", function () { | |
.on("mouseout", function() { |
packages/core/demo/data/line.ts
Outdated
@@ -22,7 +22,7 @@ export const lineData = [ | |||
]; | |||
|
|||
export const lineOptions = { | |||
title: "Line (discrete)", | |||
title: "Line (discrete) - long long long long long long long long long long long long long long time format ('MMM d, hh a and 'hh a')", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should just keep this short like before. as long as it works we're good
…-system#547) * fix(core): title string contains html ascii characters for certain symbols * update for legend and axis text * fix demo date
Title strings passed into the options are HTML number encoded (apostrophes, etc -> ')
Setting to
.text()
renders the string as is, setting to.html()
renders the string after it is decoded. The DOM html is unaffected by the change.This bug appears in the legend (see below) and axis titles but not within the toolltip (toolltip passes the strings through
.html()
)Review checklist (for reviewers only)