You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/10/26 20:52:54 UTC

[GitHub] [echarts] hughess opened a new issue #15949: SVG render issue when theme values stored as strings

hughess opened a new issue #15949:
URL: https://github.com/apache/echarts/issues/15949


   ### Version
   5.2.1
   
   ### Reproduction link
   [https://jsfiddle.net/eb9dz2f3/3/](https://jsfiddle.net/eb9dz2f3/3/)
   
   ### Steps to reproduce
   1. Add line width to template, but store it as a string (same as the output from ECharts theme builder)
   2. Use SVG renderer
   3. Change `grid: top` argument until the line stops appearing (in example link, changing it to 17% makes the line disappear, but 18% works)
   
   ### What is expected?
   Line should render as normal
   
   ### What is actually happening?
   Line doesn't render under both of these conditions:
    - Renderer is SVG
    - Certain values are inputted into the grid: top argument
   
   ---
   This is a strange issue. A line chart I built stopped rendering the line, but I was able to get a bar and scatter to work with the same data. I had the line working earlier and the only thing I changed to break it was the `grid: top` argument. After playing around with different values for that argument, I found that some numbers worked while others didn't. 
   
   I checked the renderer and this is an issue specific to SVG - the chart works as normal with Canvas. My assumption was that there is some strange rounding happening when it tries to calculate the position of the line. I couldn't find anything wrong with the underlying SVG elements on inspection in my browser, so the actual problem is a mystery to me.
   
   After looking further into it, I found that the line width option in my custom theme file was stored as a string instead of a number. Changing it to a number solved the SVG rendering problem.
   
   I built the custom theme using the ECharts theme builder, which outputs a string if you edit the line width option.
   
   I am not sure if this is an issue with the theme builder or SVG rendering, but wanted to share in case it's helpful to anyone else. Everything is working for me now.
   
   <!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
   <!-- This issue is in English. DO NOT REMOVE -->


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] Ovilia commented on issue #15949: SVG render issue when theme values stored as strings

Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #15949:
URL: https://github.com/apache/echarts/issues/15949#issuecomment-960380342


   Thanks for reporting. I will look into it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] hughess commented on issue #15949: SVG render issue when theme values stored as strings

Posted by GitBox <gi...@apache.org>.
hughess commented on issue #15949:
URL: https://github.com/apache/echarts/issues/15949#issuecomment-959279722


   Perfect, thanks @plainheart!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] hughess commented on issue #15949: SVG render issue when theme values stored as strings

Posted by GitBox <gi...@apache.org>.
hughess commented on issue #15949:
URL: https://github.com/apache/echarts/issues/15949#issuecomment-959279722


   Perfect, thanks @plainheart!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] pissang commented on issue #15949: SVG render issue when theme values stored as strings

Posted by GitBox <gi...@apache.org>.
pissang commented on issue #15949:
URL: https://github.com/apache/echarts/issues/15949#issuecomment-960379754


   ping @Ovilia 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] hughess commented on issue #15949: SVG render issue when theme values stored as strings

Posted by GitBox <gi...@apache.org>.
hughess commented on issue #15949:
URL: https://github.com/apache/echarts/issues/15949#issuecomment-959279722


   Perfect, thanks @plainheart!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] hughess commented on issue #15949: SVG render issue when theme values stored as strings

Posted by GitBox <gi...@apache.org>.
hughess commented on issue #15949:
URL: https://github.com/apache/echarts/issues/15949#issuecomment-959279722


   Perfect, thanks @plainheart!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart commented on issue #15949: SVG render issue when theme values stored as strings

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #15949:
URL: https://github.com/apache/echarts/issues/15949#issuecomment-953068619


   This is definitely caused by an unexpected `lineWidth` of type `string`.  Let's take a look at the `rect` command in SVG path builder. https://github.com/ecomfe/zrender/blob/master/src/svg/graphic.ts#L247-L253
   We will find there will be a calculation error when the `width/height` of type `string` plus the numeric `x/y`.
   
   I'm not sure if it's necessary to be fixed. But anyway, we should ensure that the `lineWidth` is a number.  @pissang 
   
   The theme builder does need further improvement. @Ovilia 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] commented on issue #15949: SVG render issue when theme values stored as strings

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #15949:
URL: https://github.com/apache/echarts/issues/15949#issuecomment-952316344


   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 it contains **a minimum reproducible demo** and necessary **images** to illustrate. Otherwise, our committers will ask you to do so.
   
   *A minimum reproducible demo* should contain as little data and components as possible but can still illustrate your problem. This is the best way for us to reproduce it and solve the problem faster.
   
   You may also check out the [API](https://echarts.apache.org/api.html) and [chart option](https://echarts.apache.org/option.html) 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 to our [mailing list](https://echarts.apache.org/maillist.html).
   
   Have a nice day! 🍵


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] plainheart edited a comment on issue #15949: SVG render issue when theme values stored as strings

Posted by GitBox <gi...@apache.org>.
plainheart edited a comment on issue #15949:
URL: https://github.com/apache/echarts/issues/15949#issuecomment-953068619


   This is definitely caused by an unexpected `lineWidth` of type `string`.  Let's take a look at the `rect` command in SVG path builder. https://github.com/ecomfe/zrender/blob/master/src/svg/graphic.ts#L247-L253
   We will find there will be a calculation error when the `width/height` of type `string` plus the numeric `x/y`.
   
   I'm not sure if it's necessary to be fixed. But anyway, we should ensure that the `lineWidth` is a number.  @pissang 
   
   Fortunately, this issue doesn't exist in the next version.
   https://github.com/ecomfe/zrender/blob/next/src/svg/SVGPathRebuilder.ts#L113-L120
   
   The theme builder does need further improvement. @Ovilia 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org