Comments (3)
I'm confused. Are you saying that adding that line causes the tick labels to work?
from chart-clicker.
Yes, it is only this line. But I think it is not the final fix.
Under Windows every label consists of a ββ ( empty string) in a line and the expected label-text in the next line.
The mentioned code line skips all empty lines and let only pass the lines with the label-text.
Therefore it produces the right output.
If I find time I will dig a little more in detail into the code. I think it is difficult for you, when you donβt use Windows.
Maybe it has something to do with issue #21. Also here is the y-axis label with spaces splitted in more lines (one line for every single word).
from chart-clicker.
After exploring the code, I got a little bit closer to the source of the problem.
A quick fix for this issue and issue #21 would be a comment sign:
return 0;
in the following code sequence
Graphics\Primitive\Driver\Cairo\TextLayout.pm in sub layout line 44:
wrapper => Text::Flow::Wrap->new(
check_width => sub {
my $str = shift;
my $r = $driver->get_text_bounding_box($comp, $str);
unless($width) {
# Catch the "no width" case.
return 1;
}
if($r->width > $width) {
print " get_text_bounding_box->width: ".$r->width."; width: $width; text: $str \n"; #!!d
# return 0;
}
return 1;
}
It disables the Text wrapper feature. But at the moment I don't see any advantage of this feature.
The supplementary line mentioned above is then no more necessary.
the print statement is only for debugging reason. The output of this statement is shown here:
get_text_bounding_box->width: 28; width: 26; text: 1.00
get_text_bounding_box->width: 28; width: 26; text: 3.20
get_text_bounding_box->width: 28; width: 26; text: 5.40
get_text_bounding_box->width: 28; width: 26; text: 7.60
get_text_bounding_box->width: 28; width: 26; text: 9.80
get_text_bounding_box->width: 35; width: 33; text: 12.00
get_text_bounding_box->width: 193; width: 191; text: Ipsum is a very long x-axis label [h]
get_text_bounding_box->width: 28; width: 26; text: 0.30
get_text_bounding_box->width: 28; width: 26; text: 1.40
get_text_bounding_box->width: 28; width: 26; text: 2.50
get_text_bounding_box->width: 28; width: 26; text: 3.60
get_text_bounding_box->width: 28; width: 26; text: 4.70
get_text_bounding_box->width: 28; width: 26; text: 5.80
get_text_bounding_box->width: 40; width: 20; text: Lorem
get_text_bounding_box->width: 65; width: 20; text: Lorem with
get_text_bounding_box->width: 97; width: 20; text: Lorem with more
get_text_bounding_box->width: 134; width: 20; text: Lorem with more words
get_text_bounding_box->width: 172; width: 20; text: Lorem with more words [W/m?]
Width is the component width:
my $width = $comp->width ? $comp->width : $comp->minimum_inside_width;
So the problem is that the component width is too small, mostly at the first check of
Text::Flow->wrapper->check_width
The output is therefore an empty string in the first line and the single words in the next lines.
This is the reason, why the labels are not plottet on Windows system and this is the reason
why longer y-axis labels with spaces are splitted in single words, which are plottet over each others (issue #21).
Attached ist the line-examples with longer labels:
I don't know how the component width of the Textbox is set and how the layout-process is working. Therefore
I stopp at this point my debugging.
from chart-clicker.
Related Issues (20)
- Feature Request: Render graph in reverse HOT 1
- Bug in Legend draw HOT 1
- Bug in drawing range_axis label with spaces in name. HOT 2
- unable to create Bar Graph HOT 1
- Passing a list of values to enum is deprecated HOT 1
- Circular references causing memory leaks HOT 1
- Chart::Clicker fails to install because Graphics::Primitive::Driver::Cairo doesn't install HOT 2
- Large amount of white space around range label HOT 1
- broken link on home page HOT 1
- t/axis-division-rounded.t test fails on FreeBSD 10.1 with -Duselongdouble
- MS Windows failure (probably related to Graphics-Primitive-Driver-GD-0.01) HOT 2
- Warnings with recent Moose versions HOT 4
- Question: Is it possible to draw text on chart? HOT 1
- Chart::Clicker makes way too many set-font-options and select-font-face calls
- Rendering Blurriness Due to Default Cairo Library Grid System
- Need Option to Reverse Order of Legend Items
- Decimals of 0 value not scaling correctly on chart
- Examples not working HOT 2
- Additional modules required on Kubuntu 18
- Chart::Clicker::Axis + LinearRounded FAIL under -Dusequadmath
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chart-clicker.