* If return null/undefined, indicate that should not use datasetModel.
(seriesModel)
| 21080 | * If return null/undefined, indicate that should not use datasetModel. |
| 21081 | */ |
| 21082 | function getDatasetModel(seriesModel) { |
| 21083 | var option = seriesModel.option; |
| 21084 | // Caution: consider the scenario: |
| 21085 | // A dataset is declared and a series is not expected to use the dataset, |
| 21086 | // and at the beginning `setOption({series: { noData })` (just prepare other |
| 21087 | // option but no data), then `setOption({series: {data: [...]}); In this case, |
| 21088 | // the user should set an empty array to avoid that dataset is used by default. |
| 21089 | var thisData = option.data; |
| 21090 | if (!thisData) { |
| 21091 | return seriesModel.ecModel.getComponent('dataset', option.datasetIndex || 0); |
| 21092 | } |
| 21093 | } |
| 21094 | |
| 21095 | /** |
| 21096 | * The rule should not be complex, otherwise user might not |
no outgoing calls
no test coverage detected