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

[Feature Request]: Wind Rose & Polar Histogram #6

Open
hz14np opened this issue May 20, 2022 · 3 comments
Open

[Feature Request]: Wind Rose & Polar Histogram #6

hz14np opened this issue May 20, 2022 · 3 comments

Comments

@hz14np
Copy link

hz14np commented May 20, 2022

Hi,

Thank you for your great work! Simply love it!

Would you happen to be working on a Wind Rose chart (example: https://jsfiddle.net/y64cLs5j/2/) or a Polar plot with binned histogram (example: https://www.mathworks.com/help/matlab/ref/polarhistogram.html) chart widgets?

@Cvd0
Copy link

Cvd0 commented Apr 10, 2024

@hz14np did you happen to find a working wind rose chart?

@X1folta
Copy link

X1folta commented Apr 10, 2024

You can add basically any visualization library into Thingsboard inside the widget under 'Resources' and start right off. I use primarily Echarts and add it via:

https://cdnjs.cloudflare.com/ajax/libs/echarts/5.3.2/echarts.min.js

You then need to add it to the widget container through:

`
let divId = 'barStackedColumn_'+self.ctx.widget.id;
div = document.createElement('div');
div.style = 'height: 100%; width: 100%; margin:0';
div.setAttribute('id',divId);
self.ctx.$container.html(div);

self.ctx.$scope.datasource = self.ctx.defaultSubscription.datasource;
self.ctx.$scope.data = self.ctx.defaultSubscription.data;
option.title.text = self.ctx.widgetTitle;


myChart = echarts.init(div);
self.ctx.myChart = myChart;

myChart.setOption(option);

`

This is a part of a starting template I use when creating new charts. Important to note is that 'option' is the chart configuration seen as in examples of Echarts like this sunburst for example. While Thingsboard has amped up production of certain widgets as of late you cant know for sure, when a widget will drop that fits your requirements. Therefore I advise on trying it yourself.

@Cvd0
Copy link

Cvd0 commented Apr 10, 2024

Alright, thank you for the headstart @X1folta, I will try and write one myself!

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

3 participants