Completed
Last Updated: 21 Jun 2021 07:20 by ADMIN
Musheng
Created on: 16 Nov 2020 16:32
Category: Kendo UI® for Vue
Type: Bug Report
1
Using the "ChartSeriesItem" nested tag in Chart throws and error in the console

I'm submitting a Bug report

Current behavior

<chart :title-text="'Gross domestic product growth /GDP annual %/'" 
        :legend-position="'bottom'"
        :series-defaults-type="'area'"
        :category-axis-categories="categoryAxisData"
        :category-axis-major-grid-lines-visible="false"
        :category-axis-labels-rotation="'auto'"
        :value-axis-labels-format="'{0}%'"
        :value-axis-line-visible="false"
        :value-axis-axis-crossing-value="-10"
        :tooltip-visible="true"
        :tooltip-format="'{0}%'"
        :tooltip-template="tooltipTemplate"
        :theme="'sass'">
    <chart-series-item :name="'India'"
                        :data="indiaData"
                        :line-style="'smooth'">
    </chart-series-item>
    <chart-series-item :name="'World'"
                        :data="worldData"
                        :line-style="'smooth'">
    </chart-series-item>
    <chart-series-item :name="'Haiti'"
                        :data="haitiData"
                        :line-style="'smooth'">
    </chart-series-item>
</chart>

When using the ChartSeriesItem tags to define the data in the Chart component the following error appears in the console once the Vue project is started.
image

Expected behavior

<chart-series-item :name="'India'"
                        :data="indiaData"
                        :line-style="'smooth'">
    </chart-series-item>
    <chart-series-item :name="'World'"
                        :data="worldData"
                        :line-style="'smooth'">
    </chart-series-item>
    <chart-series-item :name="'Haiti'"
                        :data="haitiData"
                        :line-style="'smooth'">
    </chart-series-item>

Using a definition like the above, we should be able to define Chart's data with no issues.

Minimal reproduction of the problem with instructions

  1. Open this project
  2. In the console run "npm install"
  3. In the console run "npm run serve"
  4. Open the URL of the project and see the browser's console
1 comment
ADMIN
Petar
Posted on: 16 Nov 2020 16:34
The workaround that can be applied for the current issue is to define the Chart as follows:
<template>
    <div>
        <chart :title-text="'Gross domestic product growth /GDP annual %/'"
                :series="series"
               :legend-position="'bottom'"
               :series-defaults-type="'area'"
               :category-axis-categories="categoryAxisData"
               :category-axis-major-grid-lines-visible="false"
               :category-axis-labels-rotation="'auto'"
               :value-axis-labels-format="'{0}%'"
               :value-axis-line-visible="false"
               :value-axis-axis-crossing-value="-10"
               :tooltip-visible="true"
               :tooltip-format="'{0}%'"
               :tooltip-template="tooltipTemplate"
               :theme="'sass'">
        </chart>
    </div>
</template>
Where the series variable is defined like this:
computed: {
    series () {
        return [
            { name:'India', data: this.indiaData, line: {style: 'smooth'}},
                { name:'World', data: this.worldData, line: {style: 'smooth'}},
                { name:'Haiti', data: this.haitiData, line: {style: 'smooth'}}
        ]
    } 
}

 

Regards,
Petar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.