Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Hexadecimal values on chart(How to present hexadecimal values on bar chart?)
Hexadecimal values on chart [message #793685] Wed, 08 February 2012 12:41 Go to next message
Dejan Vujanic is currently offline Dejan VujanicFriend
Messages: 66
Registered: October 2011
Member
I have two fields:

First:0000AAAABBBBBBBBBBBBBBAAAA987653
Second:00CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCBCCBBBBBBBBBBBBBBBBBAAAAAA9999999999999999999999999999

Each character in field value represents hexadecimal value.
So on y-axis we have limited values from 0 to 15 (from 0 to F).
On x-axis is value from 0 to 512 because each of this two fields have 513 characters.


So on example balded A in first field will have coordinates (5,10). 5 is x value because it is 5-th character in field and 10 because A is hexadecimal 10.

Similar balded C in second field will have coordinates(3,12).

Picture how it looks in some system is below.

Does someone knows how to solve and present this? Thanks

index.php/fa/7083/0/
  • Attachment: hexa.jpg
    (Size: 22.42KB, Downloaded 241 times)

[Updated on: Wed, 08 February 2012 18:52]

Report message to a moderator

Re: Hexadecimal values on bar chart [message #793900 is a reply to message #793685] Wed, 08 February 2012 18:23 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I am not 100% certain what you need. Do both strings contain 512 chars?

Jason

On 2/8/2012 7:41 AM, cankovicv wrote:
> I have two fields:
>
> First:0000AAAABBBBBBBBBBBBBBAAAA987653
> Second:00CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCBCCBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBCBBBBBBBBBBBBBBBBBBBBB2BBBBBBBBBBB2BBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAAAAAAA9999999999999999999999999999
>
> Each character in field represents hexadecimal value.
> So on y-axis we have limited values from 0 to 15 (from 0 to F).
> On x-axis is value from 0 to 512 because each of this two fields can have maximum 512 characters.
>
>
> So on example balded A in first field will have coordinates (5,10). 5 is x value because it is 5-th character in field and 10 because A is hexadecimal 10.
>
> Similar balded C in second field will have coordinates(3,12).
>
> Picture how it looks in some system is below.
>
> Can someone knows how to solve and present this? Thanks
>
>
Re: Hexadecimal values on bar chart [message #793926 is a reply to message #793900] Wed, 08 February 2012 18:51 Go to previous messageGo to next message
Dejan Vujanic is currently offline Dejan VujanicFriend
Messages: 66
Registered: October 2011
Member
Thanks Jason for response, yes both fields contains 513 characters (not 512 my mistake because from 0 to 512 are 513 spots that is hexadecimal values).

Do you know maybe how to get each character value separately from that huge string value and how to do the mapping of coordinates for the values of y axis (0 -15 hexadecimal) and x-axis (0-512)? I would appreciate some example if you have.
Thanks!!!
Re: Hexadecimal values on bar chart [message #793968 is a reply to message #793926] Wed, 08 February 2012 19:35 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Take a look at the attached example. Look at the scripts on the
scripted dataset.

Jason

On 2/8/2012 1:51 PM, cankovicv wrote:
> Thanks Jason for response, yes both fields contains 513 characters (not
> 512 my mistake because from 0 to 512 are 513 spots that is hexadecimal
> values).
>
> Do you know maybe how to get each character value separately from that
> huge string value and how to do the mapping of coordinates for the
> values of y axis (0 -15 hexadecimal) and x-axis (0-512)? I would
> appreciate some example if you have.
> Thanks!!!
  • Attachment: hexchart.zip
    (Size: 4.23KB, Downloaded 76 times)
Re: Hexadecimal values on bar chart [message #798196 is a reply to message #793968] Tue, 14 February 2012 11:22 Go to previous messageGo to next message
Dejan Vujanic is currently offline Dejan VujanicFriend
Messages: 66
Registered: October 2011
Member
Jason thanks for your useful material.
I just have two questions:

1. you bound xstring with some value...xstring = "00CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC... but how to bind it in script with some field? because this values will be different for each record in DB.
can I use something like xstring=field_name or what is the correct expression? same problem and for ystring...?
2. what is necessary to add to this be aplicable for two fields? I saw that you commented ystring
So I would add in open method this:
iiy=0;
ystring="000AB..."
leny=ystring.length;

and in fetch method:

if( iiy >= leny ) return false;

row["xval"] = iiy; // parseInt(xstring.substr(iiy,1),16);
row["yval"] = parseInt(xstring.substr(iiy,1),16);

iiy++
return true;


is this enough?

Thanks
Re: Hexadecimal values on bar chart [message #798446 is a reply to message #798196] Tue, 14 February 2012 17:56 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I have modified the example to illustrate how you could nest the data
set in another data set to get the initial string that you will be using
for the chart data set. Look at the script and look at the binding tab
for the chart. Specifically look at the parameters for the binding of
the chart which references the outer tables data value. For the two
field, do you want a second chart or a second series on the same chart?

Jason

On 2/14/2012 6:22 AM, cankovicv wrote:
> Jason thanks for your useful material.
> I just have two questions:
>
> 1. you bound xstring with some value...xstring =
> "00CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC... but how to bind it in
> script with some field? because this values will be different for each
> record in DB.
> can I use something like xstring=field_name or what is the correct
> expression? same problem and for ystring...?
> 2. what is necessary to add to this be aplicable for two fields? I saw
> that you commented ystring
> So I would add in open method this:
> iiy=0;
> ystring="000AB..."
> leny=ystring.length;
>
> and in fetch method:
>
> if( iiy >= leny ) return false;
>
> row["xval"] = iiy; // parseInt(xstring.substr(iiy,1),16);
> row["yval"] = parseInt(xstring.substr(iiy,1),16);
>
> iiy++
> return true;
>
>
> is this enough?
>
> Thanks
  • Attachment: hexchart.zip
    (Size: 4.66KB, Downloaded 50 times)
Re: Hexadecimal values on bar chart [message #802761 is a reply to message #798446] Mon, 20 February 2012 12:12 Go to previous messageGo to next message
Dejan Vujanic is currently offline Dejan VujanicFriend
Messages: 66
Registered: October 2011
Member
Hi Jason, I would like second series on the same chart.
What do I have to change?

Thanks
Re: Hexadecimal values on bar chart [message #803645 is a reply to message #802761] Tue, 21 February 2012 16:10 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Modify the scripted datasets and refresh the bindings on the chart and
table. Do refresh select the binding tab in the properties editor and
click on the refresh button. You will need to add another input
parameter to the nested dataset as well. Look at the attached modified
example.

Jason

On 2/20/2012 7:12 AM, cankovicv wrote:
> Hi Jason, I would like second series on the same chart.
> What do I have to change?
>
> Thanks
  • Attachment: hexchart.zip
    (Size: 5.04KB, Downloaded 71 times)
Re: Hexadecimal values on bar chart [message #804517 is a reply to message #803645] Wed, 22 February 2012 18:18 Go to previous messageGo to next message
Dejan Vujanic is currently offline Dejan VujanicFriend
Messages: 66
Registered: October 2011
Member
You are GENIUS!!! I can't thank you enough!!!!

This is exactly what I wanted (similar to the first graphic) and it looks very nice:)
Just one more little question- can I somehow move this graph to the left to assemble it to the y and x axis?
Thank you Jason once again!!!

index.php/fa/7257/0/
  • Attachment: Capture.JPG
    (Size: 38.37KB, Downloaded 180 times)

[Updated on: Wed, 22 February 2012 18:20]

Report message to a moderator

Re: Hexadecimal values on bar chart [message #805361 is a reply to message #804517] Thu, 23 February 2012 17:11 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

This is an issue with the area chart type. You can bump the chart to
the left with some script but it will not extend to the furthest point
to the right. For example put a script like this in:

function beforeDrawSeries( series, seriesRenderer, context )

{
if( series.getSeriesIdentifier() == "Series 1" ||
series.getSeriesIdentifier() == "Series 2"){
var dpharray =
seriesRenderer.getSeriesRenderingHints().getDataPoints();

for( j=0;j<dpharray.length;j++){
var xval = dpharray[j].getLocation().getX();
dpharray[j].getLocation().setX(xval-100);
}

}
}

Jason



On 2/22/2012 1:18 PM, cankovicv wrote:
> You are GENIUS!!! I can't thank you enough!!!!
>
> This is exactly what I wanted (similar to the first graphic) and it looks very nice:)
> Just one more little question- can I somehowe move this graph to the left to assemble it to the y and x axis?
> Thank you Jason once again!!!
>
>
Previous Topic:Calendar/GregorianCalender exception
Next Topic:Really confused by data bindings
Goto Forum:
  


Current Time: Mon Dec 22 22:48:02 GMT 2014

Powered by FUDForum. Page generated in 0.02108 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software