In the past, I've supported changes to the chart range by implementing it in the Angular code. Since the range changes are implemented from the side that causes the re-draw, instead of the chart's internal state.. it makes the experience a little smoother.
Does anyone ever created a custom pattern formatter ?
I have this value 542 that represent the number of days
and I want to format it and display on my chart 1yr5m
any ideas how I can do that ?
Thanks!
Nicholas Bering
@nbering
I would provided that as a formatted value in your DataTable rather than using a Formatter.
I would give you a more detailed answer but I’m limited in my time during the workday so I can’t go look for links for you.
maylin2019
@maylin2019
Hello, may I ask how to dynamic add data to google chart after initialize the chart object in AngularJS?
Nicholas Bering
@nbering
The library provides data binding using Angular’s regular change detection mechanism. Just change your object and the chart will be redrawn.
maylin2019
@maylin2019
Hi Nicholas, thanks for the response. It helped. Now I am trying to customize tooltip based on the post at https://codepen.io/Toomaaa/pen/EmBwwZ. However when I tried something as simple as {"v":"<div>My Customized Tooltip</div>"} , I did get "My Customized Tooltip", instead I got the raw HTML "<div>My Customized Tooltip</div>". I had all the options setup correctly.
Nicholas Bering
@nbering
There’s a property you can set on the column to support HTML.
Taking a look at your sample.
Nicholas Bering
@nbering
@maylin2019 Can you provide a sample of what you're trying that doesn't work?
maylin2019
@maylin2019
I did look deeply into the sample. I have options.tooltip: {isHtml: true}, as well as cols {id:"tooltip", type:"string", role:'tooltip', 'p':{'html':true}},
Nicholas Bering
@nbering
Looks correct.
maylin2019
@maylin2019
Of course I am NOT using generic Google Chart, but AngularJS Google Chart through inject of googlechart with <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-google-chart/1.0.0-beta.1/ng-google-chart.js" type="text/javascript"></script>
Should I try to consider using something other than 1.0.0-beta.1?
Nicholas Bering
@nbering
The primary changes for the beta version were around how the Google Chart library was loaded. Using the "stable" version shouldn't affect this.
maylin2019
@maylin2019
Don't worry. The default tooltip works fine for me. I certainly can customize the content of the tootip, just NOT the shape of the tooltip box. No big deal. Thanks anyway.
Rushikesh
@Rushikesh89
@nbering Can you please tell me.How can i display value over each bar in bar chart ? I am using ng-google-chart.js
Nicholas Bering
@nbering
I’m in transit at the moment, but if you look at Labels in the upstream Google Charts docs, that might help you.
Rushikesh
@Rushikesh89
@nbering Thanks for quick reply. I am using ng-google-chart and setting data array to the chart object. I tried setting role-annotation to data array but it is not working.
Nicholas Bering
@nbering
Can you provide a sample of what you tried on CodePen or JSFiddle?