question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Correct way to straighten smoothed lines for ThemeRiver chart (question)

See original GitHub issue

Description

Echarts has great chart type ThemeRiver (also known as streamgraph) but this type has no options smooth or smoothMonotone like in other chart types. It does not allow to straighten the lines.

I found (probably) place in code where this options inlined but it cannot be changed from official API. Rewrite this code directly will cause a problem with the future updates.

What problem does this feature solve?

Smooth lines in charts need for best looking but when you need greater accuracy the only way — to straighten the lines.

What does the proposed API look like?

The best option to do as in other types of diagrams:

image

Workaround

Is there possible to overload the process function without changes source code? Something like the plugin or extension API. Maybe I can intercept the lines drawing …

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
creadonecommented, Aug 26, 2020

@creadone I’m trying to achieve the same thing with having straight lines, please would you be able to share how you managed to achieve it?

I was in a hurry and took the side of darkness - fixed it in the source 🤦 But it’s was really fast, take a look on micro changes. https://gist.github.com/creadone/d91447c21429d7a96e26415ba4e55f0c/revisions

diff --git a/assets/js/plugins/echarts/echarts.js b/assets/js/plugins/echarts/echarts.js
index 3d7ffca..daf6eb4 100644
--- a/assets/js/plugins/echarts/echarts.js
+++ b/assets/js/plugins/echarts/echarts.js
@@ -69072,9 +69072,9 @@ extendChartView({
      shape: {
       points: points0,
       stackedOnPoints: points1,
-     smooth: 0.4,
-     stackedOnSmooth: 0.4,
-     smoothConstraint: false
+    smooth: 0,
+    stackedOnSmooth: 0,
+    smoothConstraint: true
  },
  z2: 0
});
0reactions
etjenkinscommented, Aug 26, 2020

@creadone Thank you so much for that and for being so fast to reply! Really appreciate it 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Correct way to straighten smoothed lines for ThemeRiver chart ...
What problem does this feature solve? Smooth lines in charts need for best looking but when you need greater accuracy the only way...
Read more >
When you use a smoothed line chart, your data is not ... - VizWiz
Let's first take a look at some examples to see how badly the data can be distorted. The first chart is obviously the...
Read more >
How to smooth the angles of line chart in Excel? - ExtendOffice
1. Right click the series you need, and select Format Data Series in the context menu. See screenshot: · 2. In the Format...
Read more >
Assessing the Readability of Stacked Graphs | InnoVis
The four evaluated techniques: stacked area chart (STACK), ThemeRiver (THEME), streamgraph (STREAM), and ThemeRiver with interactive baseline straightening (INT) ...
Read more >
Smoothing Out Data Series - Charts - Excel Ribbon Tips
Select the Smoothed Line check box. Click on OK. The steps are slightly different in Excel 2013 and later versions: In your chart,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found