VisActor / VisActor/VChart

[Bug] taro 图表显示不出来 事件正常触发

Open
#3,747 8 comments 0 reactions 1 assignee View on GitHub

@neuqzxy is already working on this.

Since Feb 20, 2025.

bug
Dominant language
TypeScript
Stars
1.8k
Forks
221
Avg merge
1d 6h
Merged PRs (30d)
26

Description

Version

1.13.5

Link to Minimal Reproduction

bug

Steps to Reproduce

暂时不提供

Current Behavior

Image
代码如下:
import { View } from '@tarojs/components';
import Taro from '@tarojs/taro';
import { VChart, } from '@visactor/vchart/esm/core'
import { LineChart } from '@visactor/taro-vchart';

import { registerLabel,registerWXEnv } from '@visactor/vchart';

const spec = {
type: 'line',
data: {
values: [
{
time: '2:00',
value: 8
},
{
time: '4:00',
value: 9
},
{
time: '6:00',
value: 11
},
{
time: '8:00',
value: 14
},
{
time: '10:00',
value: 16
},
{
time: '12:00',
value: 17
},
{
time: '14:00',
value: 17
},
{
time: '16:00',
value: 16
},
{
time: '18:00',
value: 15
}
]
},
xField: 'time',
yField: 'value'
}
const Pie = () => {
VChart.useRegisters([registerLabel,registerWXEnv])

return (
    <View
      style={{
            border: '1px solid #eeeeee',
            width: '90vw'
        }}
    >

        <LineChart
          type={Taro.getEnv() as any}
          spec={spec}
          canvasId='line-echart'
          style={{ height: '35vh', width: '100%' }}
          chartConstructor={VChart}
          onChartInit={() => {
                console.log('init pie');
            }}
          onChartReady={() => {
                console.log('ready pie');
            }}
          onChartUpdate={() => {
                console.log('update pie');
            }}
        />
    </View>
);

}
export default Pie

Expected Behavior

图表能正常展示

Environment
"browserslist": [
		"last 3 versions",
		"Android >= 4.1",
		"ios >= 8"
	],
Any additional comments?

按需加载文档能不能写的详细点啊

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.