Comments (5)
The options object gets extracted from the Charts object, so it should work as you described.
new Chart({
...
tooltip: {
formatter: function () {
return new Date(this.x).toLocaleString() + '<br><b>内存:</b>' + byte_to_string(this.y)
}
}
...
});
Docs: http://www.highcharts.com/docs/chart-concepts/tooltip
from angular-highcharts.
@cebor thanks
byte_to_string
is a function convert Byte to KB MB or GB, like this:
private byteToString(data: any): string {
let kb = data / 1024
if (kb > 1024) {
let mb = kb / 1024
if (mb > 1024) {
return (mb / 1024).toFixed(2) + ' GB'
} else {
return mb.toFixed(2) + ' MB'
}
}
return kb.toFixed(2) + ' KB'
}
now browser console print: Uncaught TypeError: this.byteToString is not a function
from angular-highcharts.
I think the Problem is that, the options object and the class where you creating the Chart have different contexts.
Maybe making byteToString
to a static method will solve this. - Example
Or use something like: var _this = this
.
For further help, please show me more code of the class you declaring your chart.
from angular-highcharts.
I think, the problem is solved, so i'm closing this. Feel free to reopen.
from angular-highcharts.
yes, is solved. thanks.
from angular-highcharts.
Related Issues (20)
- License HOT 4
- Thanks everyone and wish you all the best for the holiday season. HOT 1
- StockChart doesn't contain getSVG() method HOT 6
- CommonJS or AMD dependencies Warning HOT 1
- Cannot read property 'showLoading' of undefined
- activate plugin
- angular 13 incompatible HOT 1
- Is it possible to toggle full screen using a separate button. I am using Stock Chart?
- How to resize stock chart HOT 1
- Angular Server-side rendering (SSR) - issue
- Pie chart in lower to higher all datalabels not displayed in chart view (Opera, QQ, Other) datalable not available
- Cannot read properties of undefined (reading 'forExport')
- How it differs from highcharts-angular?
- Angular 15 incompatibility HOT 1
- Update flag adds new legend elements
- No peer dependency mentioning highcharts
- Angular 16 Compatibility - Error HOT 7
- Support for Angular v17 HOT 3
- [Bug] HighchartsGantt class HOT 1
- Add support ESbuild imports HOT 4
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 angular-highcharts.