Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.4.0 break pie chart #2

Open
cjohn001 opened this issue May 5, 2023 · 1 comment
Open

Version 0.4.0 break pie chart #2

cjohn001 opened this issue May 5, 2023 · 1 comment

Comments

@cjohn001
Copy link

cjohn001 commented May 5, 2023

Just had a look at the new version. It breaks quite a couple of charts. For example the pie chart given below is completely broken:

private _chartOptions: any = {
		chart: {
			type: 'pie',
			backgroundColor: 'rgba(0,0,0,0)',
			options3d: {
				enabled: true,
				alpha: 65,
				beta: 0
			},
			marginTop: 0,
			marginBottom: 15,
			marginLeft: 15,
			marginRight: 15
		},
		tooltip: {
			// headerFormat: '',
			valueSuffix: ' %',
			shared: false,
			followTouchMove: false
		},
		legend: {
			layout: 'horizontal',
			align: 'center',
			verticalAlign: 'bottom',
			y: 8,
			floating: true,
			enabled: true,
			itemStyle: {
				color: '#6E6E6E',
				fontSize: '12px',
				fontWeight: 'normal'
			},
			useHTML: true,
			// tslint:disable-next-line: quotemark
			labelFormatter: "function () {return '<span>' + this.name + '</span>';}"
		},

		exporting: {
			enabled: false
		},
		credits: {
			enabled: false
		},
		title: {
			text: '',
			floating: true,
			style: {
				color: '#377576',
				fontSize: '14px',
				fontWeight: 'bold'
			}
		},
		plotOptions: {
			pie: {
				dataLabels: {
					enabled: true,
					useHTML: true,
					distance: 10,
					formatter:
						// tslint:disable-next-line: quotemark
						"function () { return '<span style=\"font-size:12px; color:#6E6E6E;margin-bottom:20px; font-weight: normal;\">' + this.y + '%</span>';}"
				},
				allowPointSelect: false,
				depth: 15,
				showInLegend: true
			}
		},
		series: [
			{
				type: 'pie',
				name: '',
				enableMouseTracking: true,
				keys: ['name', 'y', 'color'],
				data: [
					['Dietary Fiber', 33.3, '#e4b601'],
					['Sugar', 33.3, '#e63e11'],
					['Other', 33.3, '#85bb2f']
				]
			}
		]
	};

@NathanWalker : Unfortunately, I cannot see the old source code in the repo. Have you updated the underlaying highcharts library? I mean than issues might also arise from changed highcharts interfaces.

@NathanWalker
Copy link
Contributor

@cjohn001 thats same as this I believe:
#1
it uses latest highcharts so could be adjustment in data needed.
The source is here now for better maintainability: https://github.com/NativeScript/ui-kit/tree/main/packages/ui-charts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants