-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Type fixes #7759
Type fixes #7759
Conversation
Added one commit to fix |
|
Good point on dates. Perhaps this is the least painful way to do it though users can accidentally pass bad data (e.g. the value is booleans and something in the chart will cast it to a number). For the custom properties part, that's probably where one would want to use a custom type. |
Most of my charts are time chart with custom |
Hello. Before it's merged, can I added a few issues with type?
type ChartTypePresets =
| 'line'
| 'bar'
| 'radar'
| 'doughnut'
| 'pie'
| 'polarArea'
| 'bubble'
| 'scatter'; type: ChartTypePresets | string; // string is for custom type P.S. or shall I create own PR for these changes after this PR? |
@xr0master let's discuss those changes in their own PR |
Some issues I found in types when migrating my typescript project to V3 beta:
unknown
instead of guessing it isnumber
. Puttingnumber
here prevent the user to cast to the actual data type, with a typescript error thatnumber
is not compatible and thus cannot be casted.chart.options = {...}
, so removereadonly
modifierparsing
options is not only a dataset option, it can also be given in the root chart options, so add it toIChartOptions
ItooltipItem
dataset property type should beIChartDataset
ILinearScaleOptions
should inherit fromICartesianScaleOptions
(linear scale is a cartesian scale)tooltipFormat
property were missing from time scale options