Heatbar, dynamic position offset of text
up vote
1
down vote
favorite
I want to insert a new column in my report to graphically display a "needle" displaying the position in a range of 0% - 100% like so:
I am looking for ideas please!
My idea
Use graphic (rainbow 0%-100% in every detail column).
Use a pixel offset (somehow??) where I simply place an overly large "|" type. So if 0%-100% are 200px that would mean that to display the needle at 50% I would offset the type 100px!
charts jasper-reports heatmap
add a comment |
up vote
1
down vote
favorite
I want to insert a new column in my report to graphically display a "needle" displaying the position in a range of 0% - 100% like so:
I am looking for ideas please!
My idea
Use graphic (rainbow 0%-100% in every detail column).
Use a pixel offset (somehow??) where I simply place an overly large "|" type. So if 0%-100% are 200px that would mean that to display the needle at 50% I would offset the type 100px!
charts jasper-reports heatmap
1
Another possibility is to create a Chart Customizer. Customizers are based on JFreeChart, so you can change the look and feel of a MinMaxCategoryRenderer, for example. See: stackoverflow.com/a/40275190/59087
– Dave Jarvis
Nov 7 at 17:13
Ok. I can work with Adobe Illustrator just fine, yet I fail to understand how to manipulate the needle! (the black bar from my example) via java (iText)? I am already doing manipulation via java with "logawie iText (PDF Stamper)" - also I would guess that chartcustomizers (I already use those as well in other reports) are not an option in a report that has maybe a 1000 lines - each containing a chart needing to run the customizer
– DavidDunham
Nov 8 at 6:39
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I want to insert a new column in my report to graphically display a "needle" displaying the position in a range of 0% - 100% like so:
I am looking for ideas please!
My idea
Use graphic (rainbow 0%-100% in every detail column).
Use a pixel offset (somehow??) where I simply place an overly large "|" type. So if 0%-100% are 200px that would mean that to display the needle at 50% I would offset the type 100px!
charts jasper-reports heatmap
I want to insert a new column in my report to graphically display a "needle" displaying the position in a range of 0% - 100% like so:
I am looking for ideas please!
My idea
Use graphic (rainbow 0%-100% in every detail column).
Use a pixel offset (somehow??) where I simply place an overly large "|" type. So if 0%-100% are 200px that would mean that to display the needle at 50% I would offset the type 100px!
charts jasper-reports heatmap
charts jasper-reports heatmap
edited Nov 8 at 17:52
Alex K
18.2k1478149
18.2k1478149
asked Nov 7 at 9:15
DavidDunham
471520
471520
1
Another possibility is to create a Chart Customizer. Customizers are based on JFreeChart, so you can change the look and feel of a MinMaxCategoryRenderer, for example. See: stackoverflow.com/a/40275190/59087
– Dave Jarvis
Nov 7 at 17:13
Ok. I can work with Adobe Illustrator just fine, yet I fail to understand how to manipulate the needle! (the black bar from my example) via java (iText)? I am already doing manipulation via java with "logawie iText (PDF Stamper)" - also I would guess that chartcustomizers (I already use those as well in other reports) are not an option in a report that has maybe a 1000 lines - each containing a chart needing to run the customizer
– DavidDunham
Nov 8 at 6:39
add a comment |
1
Another possibility is to create a Chart Customizer. Customizers are based on JFreeChart, so you can change the look and feel of a MinMaxCategoryRenderer, for example. See: stackoverflow.com/a/40275190/59087
– Dave Jarvis
Nov 7 at 17:13
Ok. I can work with Adobe Illustrator just fine, yet I fail to understand how to manipulate the needle! (the black bar from my example) via java (iText)? I am already doing manipulation via java with "logawie iText (PDF Stamper)" - also I would guess that chartcustomizers (I already use those as well in other reports) are not an option in a report that has maybe a 1000 lines - each containing a chart needing to run the customizer
– DavidDunham
Nov 8 at 6:39
1
1
Another possibility is to create a Chart Customizer. Customizers are based on JFreeChart, so you can change the look and feel of a MinMaxCategoryRenderer, for example. See: stackoverflow.com/a/40275190/59087
– Dave Jarvis
Nov 7 at 17:13
Another possibility is to create a Chart Customizer. Customizers are based on JFreeChart, so you can change the look and feel of a MinMaxCategoryRenderer, for example. See: stackoverflow.com/a/40275190/59087
– Dave Jarvis
Nov 7 at 17:13
Ok. I can work with Adobe Illustrator just fine, yet I fail to understand how to manipulate the needle! (the black bar from my example) via java (iText)? I am already doing manipulation via java with "logawie iText (PDF Stamper)" - also I would guess that chartcustomizers (I already use those as well in other reports) are not an option in a report that has maybe a 1000 lines - each containing a chart needing to run the customizer
– DavidDunham
Nov 8 at 6:39
Ok. I can work with Adobe Illustrator just fine, yet I fail to understand how to manipulate the needle! (the black bar from my example) via java (iText)? I am already doing manipulation via java with "logawie iText (PDF Stamper)" - also I would guess that chartcustomizers (I already use those as well in other reports) are not an option in a report that has maybe a 1000 lines - each containing a chart needing to run the customizer
– DavidDunham
Nov 8 at 6:39
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
The easiest / most straightforward option I have found and implemented:
<image scaleImage="RetainShape" onErrorType="Blank">
<reportElement x="575" y="1" width="100" height="13" uuid="7cf54aff-65ac-40e5-8dc9-7f95d6f34d49"/>
<imageExpression>
<![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstanceFromText("
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="13" viewBox="0 0 100 13">
<defs>
<linearGradient id="linear-gradient" x1="-176.88" y1="316.13" x2="-150.45" y2="316.13" gradientTransform="matrix(3.78, 0, 0, -3.78, 689.01, 1202.56)" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="green"/>
<stop offset="1" stop-color="green" stop-opacity="0"/>
</linearGradient>
</defs>
<path d="M0,1.26H100v10.4H0Z" style="fill: url(#linear-gradient)"/>
<path d="M" + !!! OFFSET CALCULATION !!! + ",0V13" style="fill: none;stroke: #000"/>
</svg>
")]]></imageExpression>
</image>
Result:
That's nice and simple. Try replacing"
with'
.
– Dave Jarvis
Nov 8 at 16:43
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
The easiest / most straightforward option I have found and implemented:
<image scaleImage="RetainShape" onErrorType="Blank">
<reportElement x="575" y="1" width="100" height="13" uuid="7cf54aff-65ac-40e5-8dc9-7f95d6f34d49"/>
<imageExpression>
<![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstanceFromText("
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="13" viewBox="0 0 100 13">
<defs>
<linearGradient id="linear-gradient" x1="-176.88" y1="316.13" x2="-150.45" y2="316.13" gradientTransform="matrix(3.78, 0, 0, -3.78, 689.01, 1202.56)" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="green"/>
<stop offset="1" stop-color="green" stop-opacity="0"/>
</linearGradient>
</defs>
<path d="M0,1.26H100v10.4H0Z" style="fill: url(#linear-gradient)"/>
<path d="M" + !!! OFFSET CALCULATION !!! + ",0V13" style="fill: none;stroke: #000"/>
</svg>
")]]></imageExpression>
</image>
Result:
That's nice and simple. Try replacing"
with'
.
– Dave Jarvis
Nov 8 at 16:43
add a comment |
up vote
2
down vote
The easiest / most straightforward option I have found and implemented:
<image scaleImage="RetainShape" onErrorType="Blank">
<reportElement x="575" y="1" width="100" height="13" uuid="7cf54aff-65ac-40e5-8dc9-7f95d6f34d49"/>
<imageExpression>
<![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstanceFromText("
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="13" viewBox="0 0 100 13">
<defs>
<linearGradient id="linear-gradient" x1="-176.88" y1="316.13" x2="-150.45" y2="316.13" gradientTransform="matrix(3.78, 0, 0, -3.78, 689.01, 1202.56)" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="green"/>
<stop offset="1" stop-color="green" stop-opacity="0"/>
</linearGradient>
</defs>
<path d="M0,1.26H100v10.4H0Z" style="fill: url(#linear-gradient)"/>
<path d="M" + !!! OFFSET CALCULATION !!! + ",0V13" style="fill: none;stroke: #000"/>
</svg>
")]]></imageExpression>
</image>
Result:
That's nice and simple. Try replacing"
with'
.
– Dave Jarvis
Nov 8 at 16:43
add a comment |
up vote
2
down vote
up vote
2
down vote
The easiest / most straightforward option I have found and implemented:
<image scaleImage="RetainShape" onErrorType="Blank">
<reportElement x="575" y="1" width="100" height="13" uuid="7cf54aff-65ac-40e5-8dc9-7f95d6f34d49"/>
<imageExpression>
<![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstanceFromText("
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="13" viewBox="0 0 100 13">
<defs>
<linearGradient id="linear-gradient" x1="-176.88" y1="316.13" x2="-150.45" y2="316.13" gradientTransform="matrix(3.78, 0, 0, -3.78, 689.01, 1202.56)" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="green"/>
<stop offset="1" stop-color="green" stop-opacity="0"/>
</linearGradient>
</defs>
<path d="M0,1.26H100v10.4H0Z" style="fill: url(#linear-gradient)"/>
<path d="M" + !!! OFFSET CALCULATION !!! + ",0V13" style="fill: none;stroke: #000"/>
</svg>
")]]></imageExpression>
</image>
Result:
The easiest / most straightforward option I have found and implemented:
<image scaleImage="RetainShape" onErrorType="Blank">
<reportElement x="575" y="1" width="100" height="13" uuid="7cf54aff-65ac-40e5-8dc9-7f95d6f34d49"/>
<imageExpression>
<![CDATA[net.sf.jasperreports.renderers.BatikRenderer.getInstanceFromText("
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="13" viewBox="0 0 100 13">
<defs>
<linearGradient id="linear-gradient" x1="-176.88" y1="316.13" x2="-150.45" y2="316.13" gradientTransform="matrix(3.78, 0, 0, -3.78, 689.01, 1202.56)" gradientUnits="userSpaceOnUse">
<stop offset="0" stop-color="green"/>
<stop offset="1" stop-color="green" stop-opacity="0"/>
</linearGradient>
</defs>
<path d="M0,1.26H100v10.4H0Z" style="fill: url(#linear-gradient)"/>
<path d="M" + !!! OFFSET CALCULATION !!! + ",0V13" style="fill: none;stroke: #000"/>
</svg>
")]]></imageExpression>
</image>
Result:
edited Nov 8 at 16:41
Dave Jarvis
20.7k30130253
20.7k30130253
answered Nov 8 at 13:17
DavidDunham
471520
471520
That's nice and simple. Try replacing"
with'
.
– Dave Jarvis
Nov 8 at 16:43
add a comment |
That's nice and simple. Try replacing"
with'
.
– Dave Jarvis
Nov 8 at 16:43
That's nice and simple. Try replacing
"
with '
.– Dave Jarvis
Nov 8 at 16:43
That's nice and simple. Try replacing
"
with '
.– Dave Jarvis
Nov 8 at 16:43
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53186460%2fheatbar-dynamic-position-offset-of-text%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Another possibility is to create a Chart Customizer. Customizers are based on JFreeChart, so you can change the look and feel of a MinMaxCategoryRenderer, for example. See: stackoverflow.com/a/40275190/59087
– Dave Jarvis
Nov 7 at 17:13
Ok. I can work with Adobe Illustrator just fine, yet I fail to understand how to manipulate the needle! (the black bar from my example) via java (iText)? I am already doing manipulation via java with "logawie iText (PDF Stamper)" - also I would guess that chartcustomizers (I already use those as well in other reports) are not an option in a report that has maybe a 1000 lines - each containing a chart needing to run the customizer
– DavidDunham
Nov 8 at 6:39