echarts Error "Unknown dimension open" for candlestick chart with custom dimension names and zoom enabled

xam8gpfp  于 2个月前  发布在  Echarts
关注(0)|答案(6)|浏览(51)

Version

5.0.0-beta.2

Steps to reproduce

Setup a candlestick chart with encoded data with custom dimension names and zooming. It throws the following error

Unkown dimension open
validateDimensions	@	echarts.js:32773
List.each	@	echarts.js:32048
SliderZoomView._renderDataShadow	@	echarts.js:75310
SliderZoomView._buildView	@	echarts.js:75157
SliderZoomView.render

What is expected?

Custom dimensions like "Open" instead of default dimension "open" should work.

What is actually happening?

It is throwing error.

While building the zoom slider, it gets the shadowDim in CandlestickSeries.js which is "open" which is being validated without mapping it back to the dimensions defined in the dataset.

5sxhfpxr

5sxhfpxr1#

Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.

In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.

If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org . Please attach the issue link if it's a technical question.

If you are interested in the project, you may also subscribe our mailing list .

Have a nice day! 🍵

whhtz7ly

whhtz7ly3#

I could not reproduce it on the gallery as it seems to be using 4.8. Below is the options object with which I can reproduce it locally using 5.0.0-beta.2

options = {
	xAxis: {
		data: ['2017-10-24', '2017-10-25', '2017-10-26', '2017-10-27']
	},
	yAxis: {},
	dataZoom: [
		{ show: true, type: 'slider', xAxisIndex: 0 },
		{ show: true, type: 'inside', xAxisIndex: 0 },
	],
	dataset: [
		{ 
			dimensions: [
				{ name: "Date"},
				{ name: "Open"},
				{ name: "Adj Close" },
				{ name: "Low" },
				{ name: "High" }
				],
			source: [
			['2017-10-24',20, 30, 10, 35],
			['2017-10-25',40, 35, 30, 55],
			['2017-10-26',33, 38, 33, 40],
			['2017-10-27',40, 40, 32, 42]]
		}],
	series: [{
		type: 'candlestick',
		encode: {
			x: 0,
			y: [1,2,3,4]
		}
	}]
	};
zed5wv10

zed5wv104#

Unkown dimension open is not concerning, but there is an error which should be fixed.

wf82jlnq

wf82jlnq5#

This issue is labeled with priority: high , which means it's a frequently asked problem and we will fix it ASAP.

jckbn6z7

jckbn6z76#

coordinate 'open' is necessary in candlestick.
Just like coordinate 'x' , 'y' are necessary in cartesian scatter.

相关问题