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

MG-93 - Add support for creating charts #103

Merged
merged 9 commits into from
Feb 2, 2024

Conversation

Musilah
Copy link
Contributor

@Musilah Musilah commented Jan 30, 2024

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Dependency Update

What does this do?

This creates chart templates that will be added to the widgets.

  • Add Apache E-Charts to the Magistrala dashboards.
  • The charts should be able to use the SENML data format used in Magistrala.

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

  • Yes
  • No

Did you document any new/modified functionality?

  • Yes
  • No

Notes

The charts being added include:

  1. Time series line chart
  2. Time series bar graph
  3. Analogue gauge
  4. Radial temperature gauge
  5. Pie chart
  6. Donut chart
  7. Dynamic line and bar chart
  8. Stacked area line chart
  9. Range chart
  10. Analogue speed gauge
    image

@dborovcanin dborovcanin added the dashboards Dashboards label Jan 31, 2024
@dborovcanin
Copy link
Contributor

@Musilah Please resolve the conflicts and mark as Ready for review when it's ready.

Copy link
Contributor

@dborovcanin dborovcanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a separate templates subdirectory for charts and charts modals.

@@ -5,15 +5,15 @@
"packages": {
"": {
"devDependencies": {
"prettier": "^3.1.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you removing the prettier dependency? It's used for prettier formatting

ui/jsonObject.go Outdated
@@ -21,59 +21,65 @@ func CreateItem() []Item {
Widget: "lineChart",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename this file to a more descriptive name.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and remove the to be deleted comment

ui/jsonObject.go Outdated
Content: "This is a small sentence about a line chart",
Image: "https://example.com/image9.jpg",
Widget: "gauge",
Widget: "tempGauge",
},
{
Title: "Line Chart",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line chart is being repeated a couple of times

ui/charts.go Outdated
{
Title: "Time Series Line Chart",
Content: "This is a small sentence about a line chart",
Image: "https://example.com/image1.jpg",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the image field if we are not using it. If we are using it, find relevant open source images to use for the images

height: 600,
});
var app = {};
const categories = (function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use var instead of const

Copy link
Contributor

@dborovcanin dborovcanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newly added widgets are not resizable. However, if I first save and after that enter edit mode, I can see the resize option.

Signed-off-by: ianmuchyri <[email protected]>
@dborovcanin dborovcanin merged commit 8ad76e4 into absmach:dashboards Feb 2, 2024
ianmuchyri added a commit to ianmuchyri/magistrala-ui that referenced this pull request Feb 2, 2024
* add charts support

Signed-off-by: Musilah <[email protected]>

* add bar and line charts

Signed-off-by: Musilah <[email protected]>

* add charts subdirectory

Signed-off-by: Musilah <[email protected]>

* fox service.go

Signed-off-by: Musilah <[email protected]>

* add dynamicdatachartmodal

Signed-off-by: Musilah <[email protected]>

* add images to widgets

Signed-off-by: Musilah <[email protected]>

* add chart widget images

Signed-off-by: Musilah <[email protected]>

* fix: remove copyright images

Signed-off-by: Musilah <[email protected]>

* remove comment from code

Signed-off-by: ianmuchyri <[email protected]>

---------

Signed-off-by: Musilah <[email protected]>
Signed-off-by: ianmuchyri <[email protected]>
Co-authored-by: ianmuchyri <[email protected]>
dborovcanin pushed a commit that referenced this pull request Feb 5, 2024
* add charts support

Signed-off-by: Musilah <[email protected]>

* add bar and line charts

Signed-off-by: Musilah <[email protected]>

* add charts subdirectory

Signed-off-by: Musilah <[email protected]>

* fox service.go

Signed-off-by: Musilah <[email protected]>

* add dynamicdatachartmodal

Signed-off-by: Musilah <[email protected]>

* add images to widgets

Signed-off-by: Musilah <[email protected]>

* add chart widget images

Signed-off-by: Musilah <[email protected]>

* fix: remove copyright images

Signed-off-by: Musilah <[email protected]>

* remove comment from code

Signed-off-by: ianmuchyri <[email protected]>

---------

Signed-off-by: Musilah <[email protected]>
Signed-off-by: ianmuchyri <[email protected]>
Co-authored-by: ianmuchyri <[email protected]>
dborovcanin pushed a commit that referenced this pull request Feb 5, 2024
* add charts support

Signed-off-by: Musilah <[email protected]>

* add bar and line charts

Signed-off-by: Musilah <[email protected]>

* add charts subdirectory

Signed-off-by: Musilah <[email protected]>

* fox service.go

Signed-off-by: Musilah <[email protected]>

* add dynamicdatachartmodal

Signed-off-by: Musilah <[email protected]>

* add images to widgets

Signed-off-by: Musilah <[email protected]>

* add chart widget images

Signed-off-by: Musilah <[email protected]>

* fix: remove copyright images

Signed-off-by: Musilah <[email protected]>

* remove comment from code

Signed-off-by: ianmuchyri <[email protected]>

---------

Signed-off-by: Musilah <[email protected]>
Signed-off-by: ianmuchyri <[email protected]>
Co-authored-by: ianmuchyri <[email protected]>
dborovcanin pushed a commit that referenced this pull request Feb 9, 2024
* add charts support

Signed-off-by: Musilah <[email protected]>

* add bar and line charts

Signed-off-by: Musilah <[email protected]>

* add charts subdirectory

Signed-off-by: Musilah <[email protected]>

* fox service.go

Signed-off-by: Musilah <[email protected]>

* add dynamicdatachartmodal

Signed-off-by: Musilah <[email protected]>

* add images to widgets

Signed-off-by: Musilah <[email protected]>

* add chart widget images

Signed-off-by: Musilah <[email protected]>

* fix: remove copyright images

Signed-off-by: Musilah <[email protected]>

* remove comment from code

Signed-off-by: ianmuchyri <[email protected]>

---------

Signed-off-by: Musilah <[email protected]>
Signed-off-by: ianmuchyri <[email protected]>
Co-authored-by: ianmuchyri <[email protected]>
dborovcanin pushed a commit that referenced this pull request Feb 9, 2024
* add charts support

Signed-off-by: Musilah <[email protected]>

* add bar and line charts

Signed-off-by: Musilah <[email protected]>

* add charts subdirectory

Signed-off-by: Musilah <[email protected]>

* fox service.go

Signed-off-by: Musilah <[email protected]>

* add dynamicdatachartmodal

Signed-off-by: Musilah <[email protected]>

* add images to widgets

Signed-off-by: Musilah <[email protected]>

* add chart widget images

Signed-off-by: Musilah <[email protected]>

* fix: remove copyright images

Signed-off-by: Musilah <[email protected]>

* remove comment from code

Signed-off-by: ianmuchyri <[email protected]>

---------

Signed-off-by: Musilah <[email protected]>
Signed-off-by: ianmuchyri <[email protected]>
Co-authored-by: ianmuchyri <[email protected]>
dborovcanin pushed a commit that referenced this pull request Feb 9, 2024
* add charts support

Signed-off-by: Musilah <[email protected]>

* add bar and line charts

Signed-off-by: Musilah <[email protected]>

* add charts subdirectory

Signed-off-by: Musilah <[email protected]>

* fox service.go

Signed-off-by: Musilah <[email protected]>

* add dynamicdatachartmodal

Signed-off-by: Musilah <[email protected]>

* add images to widgets

Signed-off-by: Musilah <[email protected]>

* add chart widget images

Signed-off-by: Musilah <[email protected]>

* fix: remove copyright images

Signed-off-by: Musilah <[email protected]>

* remove comment from code

Signed-off-by: ianmuchyri <[email protected]>

---------

Signed-off-by: Musilah <[email protected]>
Signed-off-by: ianmuchyri <[email protected]>
Co-authored-by: ianmuchyri <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboards Dashboards
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants