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:
enter image description here



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!










share|improve this question




















  • 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

















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:
enter image description here



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!










share|improve this question




















  • 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















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:
enter image description here



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!










share|improve this question















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:
enter image description here



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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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
















  • 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














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:



enter image description here






share|improve this answer























  • That's nice and simple. Try replacing " with '.
    – Dave Jarvis
    Nov 8 at 16:43













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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

























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:



enter image description here






share|improve this answer























  • That's nice and simple. Try replacing " with '.
    – Dave Jarvis
    Nov 8 at 16:43

















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:



enter image description here






share|improve this answer























  • That's nice and simple. Try replacing " with '.
    – Dave Jarvis
    Nov 8 at 16:43















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:



enter image description here






share|improve this answer














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:



enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








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




















  • 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




















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







這個網誌中的熱門文章

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud

Zucchini