I have the following situation:
The first data bar on the x axis is starting on the left of the first tick. The date/time range is set up by SetDateScale(beg, end).
here is my code:
# The data for the bar chart
$data = [31, 52, 53, 44, 35, 46, 77, 78, 89];
my $dates = [
perlchartdir::chartTime( 2012, 3, 20, 10, 1, 0),
perlchartdir::chartTime( 2012, 3, 20, 10, 6, 0),
perlchartdir::chartTime( 2012, 3, 20, 10, 11, 0),
perlchartdir::chartTime( 2012, 3, 20, 10, 16, 0),
perlchartdir::chartTime( 2012, 3, 20, 10, 21, 0),
perlchartdir::chartTime( 2012, 3, 20, 10, 26, 0),
perlchartdir::chartTime( 2012, 3, 20, 10, 31, 0),
perlchartdir::chartTime( 2012, 3, 20, 10, 36, 0),
perlchartdir::chartTime( 2012, 3, 20, 10, 41, 0),
];
13,45 Top
#Create XYChart object
$c = new XYChart(590, 350, 0xf4f4f4, 0xffffff );
# Set the plotarea
$c->setPlotArea( 70, 5, 510, 270, 0xffffff, -1, -1, 0xcccccc, 0xcccccc );
# Add a bar chart layer using the given data
$layer = $c->addBarLayer($data);
$layer->setXData($dates);
$layer->setBarGap($perlchartdir::TouchBar);
$c->xAxis()->setMargin(63,63);
# Set the labels on the x axis.
$c->xAxis()->setDateScale(
perlchartdir::chartTime(2012, 3, 20, 10, 0, ),
perlchartdir::chartTime(2012, 3, 20, 10, 45),
);
The first bar should not start before 10:00 - what am i missing .
thank you
mychart.pl.png
|