zhuzichu520 / FluentUI

FluentUI for QML
MIT License
3.16k stars 422 forks source link

在使用FluChart时遇到的问题 #397

Closed Ranxxxxxx closed 4 months ago

Ranxxxxxx commented 6 months ago

使用方法: 在c++端传递一个100长度的QVariantList到qml中使用FluChart显示

ChartDataProvider {
    id: chartDataModel
}

FluChart{
        id: fluChart
        anchors.fill: parent
        chartType: 'line'
        chartData: {
            return {
                labels: chartDataModel.chartList,
                datasets: [{
                        label: 'My First Dataset',
                        data: chartDataModel.chartList,
                        fill: false,
                        borderColor: 'rgb(75, 192, 192)',
                        tension: 0.1
                    }]
            }
        }
        chartOptions: { return {
                maintainAspectRatio: false,
                title: {
                    display: true,
                    text: 'Chart.js Line Chart - Stacked'
                },
                tooltips: {
                    mode: 'index',
                    intersect: false
                }
            }
        }
    }

遇到问题: 1.默认大小运行时,网格显示正常,但拖大窗口后,网格显示不正常 image image

2.连续拖动边框改变窗口大小,一定次数之后,表格消失,chart.js报错 image

qrc:/qt/qml/FluentUI/JS/Chart.js:9889: TypeError: Value is undefined and could not be converted to an object
qrc:/qt/qml/FluentUI/JS/Chart.js:7290: TypeError: Type error
zhuzichu520 commented 6 months ago

https://github.com/zhuzichu520/FluentUI/commit/fe8083fcb1aa762b89cea7cad4a436473a3beaf2 已修改,拉下main分支再试试