How to set attribute in image map using JFreeChart - jfreechart
How can I set an attribute of an image map using JFreeChart in servlet?
Example:
<map id="imageMap" name="imageMap">
<area shape="rect" coords="98,200,155,328" title="(Section, First Section) = 9" alt="" href="index.html?series=Section&category=First+Section"/>
<area shape="rect" coords="50,301,674,643" title=" axisType='XAXIS' " alt=""/>
<area shape="rect" coords="0,0,50,342" title=" axisType='YAXIS' " alt=""/>
</map>
I want to set the id or the class attribute for each area tag for it to look like this:
<map id="imageMap" name="imageMap" class="sectionImageMap">
<area id="sec_1" class= "section" shape="rect" coords="98,200,155,328" title="(Section, First Section) = 9" alt="" href="javascript:getReports('this')"/>
<area id="sec_2" class= "section" shape="rect" coords="50,301,674,643" title=" axisType='XAXIS' " alt="" href="javascript:getReports('this')"/>
<area id="sec_3" class= "section" shape="rect" coords="0,0,50,342" title=" axisType='YAXIS' " alt="" href="javascript:getReports('this')"/>
</map>
You should be able to use org.jfree.chart.annotations.XYAnnotation; several are shown here and in the samples/demos.
Related
React - Parsing error: Expected corresponding JSX closing tag for <img>
Trying to use picture element for responsive images inside my React app. But I get this error: Parsing error: Expected corresponding JSX closing tag for img <section class='dd-image' data-ast-component='text' data-ast-separator='true' data-ast-title='some text' data-ast-desc='some text'> <div class='image-wrapper'> <picture class='cq-dd-image' data-ast-image-width='7676' data-ast-image-height='2399' data-ast-asset-path='test.jpg'> <source media='unknown' srcset='./images/wallpaper-3840.jpg?imwidth=3840 3840w' data-srcset='./images/wallpaper-3840.jpg?imwidth=3840 3840w' data-rendition-width='3840' type='image/jpeg' > <source media='unknown' srcset='./images/wallpaper-2880.jpg?imwidth=2880 2880w' data-srcset='./images/wallpaper-2880.jpg?imwidth=2880 2880w' data-rendition-width='2880' type='images/jpeg' > <source media='unknown' srcset='./images/wallpaper-1920.jpg?imwidth=1920 1920w' data-srcset='./images/wallpaper-1920.jpg?imwidth=1920 1920w' data-rendition-width='1920' type='images/jpeg' > <source media='(min-width: 1280px)' srcset='./images/wallpaper-1280.jpg?imwidth=1280 1280w' data-srcset='./images/wallpaper-1280.jpg?imwidth=1280 1280w' data-rendition-width='1280' type='images/jpeg' > <source media='(min-width: 960px)' srcset='./images/wallpaper-960.jpg?imwidth=960 960w' data-srcset='./images/wallpaper-960.jpg?imwidth=960 960w' data-rendition-width='960' type='images/jpeg' > <source media='(min-width: 640px)' srcset='./images/wallpaper-960.jpg?imwidth=640 640w' data-srcset='./images/wallpaper-640.jpg?imwidth=640 640w' data-rendition-width='640' type='images/jpeg' > <source media='(min-width: 480px)' srcset='./images/wallpaper-960.jpg?imwidth=480 480w' data-srcset='./images/wallpaper-480.jpg?imwidth=480 480w' data-rendition-width='480' type='images/jpeg' > <source media='(min-width: 384px)' srcset='./images/wallpaper-960.jpg?imwidth=384 384w' data-srcset='./images/wallpaper-384.jpg?imwidth=384 384w' data-rendition-width='384' type='images/jpeg' > <source media='(min-width: 320px)' srcset='./images/wallpaper-960.jpg?imwidth=320 320w' data-srcset='./images/wallpaper-320.jpg?imwidth=320 320w' data-rendition-width='320' type='images/jpeg' > <source media='(min-width: 240px)' srcset='./images/wallpaper-960.jpg?imwidth=240 240w' data-srcset='./images/wallpaper-240.jpg?imwidth=240 240w' data-rendition-width='240' type='images/jpeg' > <source media='(min-width: 1px)' srcset='./images/wallpaper-960.jpg?imwidth=160 160w' data-srcset='./images/wallpaper-160.jpg?imwidth=160 160w' data-rendition-width='160' type='images/jpeg' > <img class='default-images loaded' src='./images/wallpaper-960.jpg?imwidth=960' alt='sample-image' data-src='./images/wallpaper-960.jpg?imwidth=960' loading='lazy' data-was-processed='true' > </picture> <noscript> <picture class='cq-dd-image' data-ast-component='image' data-ast-image-width='7676' data-ast-image-height='2399' data-ast-asset-path='test.jpg'> <img class='default-image' alt='sample-image' src='./images/wallpaper-960.jpg?imwidth=960' loading='lazy' > </picture> </noscript> </div> <div class='text-over-image__body-wrapper' style='--background-gradient: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(0,0,0,0.0) 82%, rgba(0,0,0,0) 100%); background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(0,0,0,0.0) 82%, rgba(0,0,0,0) 100%)'> <div class='component__body text-over-image__body'> <h2 class='text-over-image__headline'>Some sample text</h2> <p class='text-over-image__text'>Some other text</p> <div class='colour--palette-0 text-over-image__button-wrapper'> <a href='#' class='text-over-image__button atomic--button-link' data-tracking='internal' data-tracking-link-location='text-over-image-promo' data-tracking-link-value='Read more'> <span class='atomic--button-link-wrapper'> <span class='atomic--button-link-label text-label'>Read more</span> </span> </a> </div> </div> </div> </section> How can I fix that parsing error?
All elements should have closing tags. You have multiple elements with no closing. They should look like <img (your attributes here)> </img> OR be self-closing with a forward slash, like this <img (your attributes here) /> So, using your <img> element at the end of your <picture> element as an example, use one of the methods I described above <img class='default-images loaded' src='./images/wallpaper-960.jpg?imwidth=960' alt='sample-image' data-src='./images/wallpaper-960.jpg?imwidth=960' loading='lazy' data-was-processed='true' />
React is expecting a closing tag for img element. There are two ways to do that here: <img ...your code... /> (notice the /) <img ...your code...></img>
xidel: add object into json array
I want extract some information on a website. For this, i use xidel. I use this command line: xidel --template-file template.xml --dot-notation=on and here my template file : <actions> <action> ... code before ... <page url={$url}/> <pattern> <div class="row p-r-15 p-l-15 contenu-collec"> {$collection := []} <t:loop> {$manga := {}} <div univers="1"> <div class="post-block collec-titre"> <h2 class="post-title detail-objets">{$manga.title:=.}</h2> <div> <input>{$manga.value:=#value}</input> </div> </div> </div> <!--<call action="test"/>--> {$collection := $collection.push($manga)} </t:loop> </div> </pattern> <loop var="t" list="$collection"> <call action="test"/> </loop> </action> <action id="test"> <page url="http://site"> <post name="editions" value="{$t.value}"/> <post name="action" value="collec_objets_serie"/> <post name="univers" value="1"/> <post name="user_id" value="{$userid}"/> <template> <!-- <div style="display:block;">{$t.test}</div> --> <t:loop> {$t.tome := {}} <a>{t.tome.url:=#href}</a> </t:loop> </template> </page> </action> In the loop i create a object $manga. How to add this object to the $collection array ? I have tried {$collection := $collection.push($manga)} but don't work.
Adding md-tooltip to a SVG chart?
This is an example: <svg> <g ng-repeat="rect in rectList"> <rect ng-attr-fill="rect.fill" ng-attr-x="rect.x" ng-attr-y="rect.y" ng-attr-width="rect.width" ng-attr-height="rect.height"></rect> </g> </svg> I want to add a <md-tooltip> to each of these rects. Can I do it somehow? I am talking about the Angular Material Tooltip specifically, not any other tooltip implementation from other libraries.
Try to wrap it in a div and apply the md-tooltip <div ng-repeat="status in statuses"> <md-tooltip md-direction="right"> {{status.description}} </md-tooltip> <svg > <rect width="300" height="100" > </rect> </svg> </div> Here is the working Sample
Creating a picture tap based app in Ionic or meteor?
Suppose In an App there is a pic of a hand which shows five fingers. If anybody tap on any one of the finger then suddenly a pop up will come and some data will be send to the server. Is this possible with Ionic or meteor especially the tap feature on a picture(not a button) and then a popup? Update: I figured out that it is possible through d3.js but still how to connect those fingers to dots of d3. Is there a possibility of such app in Ionic or meteor?
This should be able to be implemented very simply with the use of an image map. First create your template <template name="handClick"> <img src="hand.gif" width="xxx" height="xxx" usemap="#handmap"> <map name="planetmap"> <area id="thumb" shape="circle" coords="x,x,x" href="#"> <area id="index" shape="circle" coords="x,x,x" href="#"> <area id="middle" shape="circle" coords="x,x,x" href="#"> <area id="ring" shape="circle" coords="x,x,x" href="#"> <area id="pinky" shape="circle" coords="x,x,x" href="#"> </map> </template> Then your event listeners Template.handClick.events({ "click area": function(e) { e.preventDefault() //handle click on any area element in the template }, "click #thumb": function(e){ e.preventDefault(); //handle click on the #thumb area element } });
I don't understand why my image map is not working
What is wrong with the code below? I feel like I have everything set up to make the image map work. <img class="Europe_Map" src="images/Europe_FinalMap.jpg" width="601" height="574" alt="Europe" usemap="#europe"> <map name="europe"> <area shape="polygon" href="#" alt="Iceland" coords="724,1490,725,1489,727,1490,726,1489,727,1489,727,1489,728,1489,727,1490,729,1490,728,1490,729,1490,729,1490,729,1491,729,1492,729,1493,729,1494,729,1494,730,1494,730,1494,731,1494,731,1494,732,1494,734,1494,735,1494,736,1493,736,1491,736,1491,737,1491,738,1490,739,1490,740,1491,741,1491,743,1492,747,1492,744,1492,743,1491,743,1491,743,1490,741,1490,741,1488,744,1488,745,1488,744,1486,742,1485,743,1485,743,1485,746,1485,747,1485,747,1485,747,1484,748,1484,745,1482,746,1483,747,1484,748,1483,748,1484,750,1483,751,1483,752,1482,752,1482,753,1482,753,1481,753,1481,751,1480,751,1480,749,1479,753,1479,749,1478,751,1478,753,1478,751,1478,752,1477,752,1477,753,1478,753,1477,753,1477,753,1476,752,1476,752,1476,750,1476,750,1476,749,1477,749,1477,747,1476,749,1476,750,1475,751,1475,750,1475,748,1475,750,1474,749,1474,750,1474,748,1473,747,1472,745,1472,744,1473,744,1473,744,1473,744,1473,745,1472,745,1472,743,1472,744,1471,743,1471,743,1470,745,1471,743,1469,740,1468,742,1469,739,1468,739,1468,739,1467,739,1467,738,1467,737,1467,736,1467,735,1468,735,1467,735,1468,734,1469,734,1468,733,1467,733,1467,732,1467,730,1466,731,1466,78,1465,728,1465,726,1464,725,1464,725,1464,725,1464,723,1463,723,1463,720,1462,720,1462,720,1461,719,1462,719,1461,719,1462,718,1461,719,1463,718,1462,718,1462,718,1462,718,1461,717,1461,713,1461,713,1461,711,1460,712,1461,711,1461,711,1461,709,1460,709,1460,710,1460,709,1459,709,1459,710,1459,708,1458,706,1457,707,1458,705,1458,706,1457,698,1457,696,1457,692,1458,691,1458,691,1458,689,1458,686,1459,687,1459,687,1459,686,1459,686,1459,686,1460,686,1459,685,1461,687,1461,686,1461,686,1462,686,1461,685,1461,683,1461,684,1461,684,1461,684,1461,684,1462,683,1461,680,1462,680,1463,681,1463,679,1463,679,1463,676,1462,674,1462,672,1462,670,1462,668,1462,665,1462,665,1463,666,1463,666,1465,667,1464,669,1464,670,1464,672,1464,672,1465,673,1465,673,1465,672,1466,675,1465,676,1466,675,1466,675,1467,674,1467,677,1468,676,1468,678,1468,679,1468,678,1468,678,1468,675,1468,672,1468,673,1468,675,1468,673,1469,674,1469,676,1470,676,1471,677,1471,679,1471,678,1471,678,1471,677,1471,679,1472,677,1471,677,1472,677,1471,675,1471,674,1471,673,1470,671,1470,672,1470,672,1470,672,1471,671,1471,671,1471,670,1472,671,1472,673,1473,670,1472,671,1473,671,1474,669,1473,668,1473,669,1473,668,1473,668,1473,666,1473,664,1474,662,1474,661,1473,660,1474,661,1474,659,1473,657,1473,656,1474,657,1475,659,1475,662,1475,662,1475,663,1475,664,1475,664,1476,665,1476,665,1475,667,1476,667,1476,667,1476,668,1476,667,1476,669,1477,669,1476,670,1476,673,1476,675,1476,677,1476,677,1477,678,1478,676,1477,673,1477,672,1478,671,1478,672,1478,671,1478,675,1480,676,1480,677,1481,677,1481,678,1481,679,1481,677,1481,677,1482,676,1482,675,1481,673,1482,675,1482,676,1483,674,1482,674,1483,673,1482,673,1482,673,1483,672,1483,672,1483,672,1482,671,1483,671,1482,671,1483,670,1482,669,1482,670,1483,669,1483,668,1482,666,1483,666,1482,664,1482,664,1482,663,1482,661,1481,658,1481,657,1482,654,1482,655,1483,656,1483,657,1483,659,1483,660,1482,658,1483,661,1483,658,1485,661,1485,663,1484,663,1483,664,1484,664,1483,664,1484,666,1484,664,1485,666,1485,666,1485,667,1485,663,1485,661,1487,664,1486,665,1486,667,1486,664,1487,662,1488,664,1488,666,1488,664,1489,665,1489,666,1489,665,1489,666,1490,669,1489,670,1488,669,1487,669,1488,670,1488,670,1488,671,1488,670,1487,671,1488,671,1487,671,1488,672,1489,673,1488,672,1486,673,1487,674,1487,674,1487,674,1487,674,1486,675,1488,674,1488,675,1489,674,1489,673,1489,670,1490,673,1491,674,1491,676,1491,674,1491,675,1492,673,1491,674,1492,673,1492,672,1492,670,1491,669,1492,670,1492,670,1493,670,1493,670,1493,671,1493,672,1493,671,1493,674,1493,675,1493,675,1493,676,1493,676,1493,677,1492,678,1492,677,1491,678,1491,678,1491,679,1491,680,1491,679,1490,680,1490,681,1490,681,1489,682,1488,682,1489,683,1488,684,1488,682,1487,684,1487,683,1487,684,1487,684,1486,682,1485,684,1485,681,1484,680,1485,681,1484,683,1483,682,1483,683,1482,681,1481,684,1480,684,1479,684,1478,684,1479,685,1480,685,1481,686,1480,686,1482,687,1483,689,1484,690,1484,689,1483,690,1483,690,1482,691,1482,691,1483,691,1483,692,1483,692,1482,693,1484,693,1485,693,1486,693,1486,693,1489,695,1489,696,1489,697,1488,697,1487,699,1486,699,1485,700,1485,700,1485,701,1485,701,1485,702,1486,701,1487,701,1487,702,1488,702,1488,703,1489,704,1489,705,1489,705,1489,707,1490,708,1490,708,1490,709,1489,710,1487,712,1487,712,1486,712,1486,712,1486,713,1485,713,1484,713,1484,713,1485,713,1485,713,1487,713,1487,712,1488,712,1490,714,1490,715,1490,716,1489,717,1489,718,1488,718,1487,719,1488,718,1488,720,1488,720,1488,721,1489,721,1489,722,1490,724,1490"> </map>