Skip to content
This repository has been archived by the owner on Feb 14, 2020. It is now read-only.

Commit

Permalink
+ Axis Component improvements (Axis Title, GridLine Behavior)
Browse files Browse the repository at this point in the history
+ ChartConfiguration improvements
  • Loading branch information
downdrown committed Apr 10, 2015
1 parent 3bc15c3 commit 784ecd0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,13 @@ protected void init(VaadinRequest request) {
e.printStackTrace();
}

// *** BAR ***
// *** COLUMN ***
ChartConfiguration columnConfiguration = new ChartConfiguration();
columnConfiguration.setTitle("TestColumn");
columnConfiguration.setChartType(ChartType.BAR);
columnConfiguration.setChartType(ChartType.COLUMN);
columnConfiguration.setBackgroundColor(Colors.WHITE);


List<Object> bananaColumnValues = new ArrayList<Object>();
bananaColumnValues.add(11.3);
bananaColumnValues.add(25.1);
Expand Down Expand Up @@ -168,4 +169,4 @@ protected void init(VaadinRequest request) {
}
setContent(layout);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ public class Axis {
private boolean showLastLabel = true;
private boolean labelsEnabled = true;
private boolean allowDecimals = true;
private int tickLength = 1;
private int tickLength = 0;
private int gridLineWidth = 1;

public Axis(AxisType axisType) {
this.axisType = axisType;
}

public AxisType getAxisType() {
return axisType;
}
Expand Down Expand Up @@ -142,7 +146,7 @@ public String getHighChartValue() throws HighChartsException {
if (this.title != null) {
builder.append("title : { text: '" + this.title + "' }");
} else {
builder.append("title : { text: null }");
builder.append("title : { enabled: false}");
}

//Axis Value Type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public class ChartConfiguration {
private boolean creditsEnabled = false;
private boolean legendEnabled = true;
private boolean tooltipEnabled = true;
private Axis xAxis = null;
private Axis yAxis = null;
private Axis xAxis = new Axis(Axis.AxisType.xAxis);
private Axis yAxis = new Axis(Axis.AxisType.yAxis);
private Margin chartMargin = null;
private List<HighChartsSeries> seriesList = new ArrayList<HighChartsSeries>();
private List<Color> colors = new ArrayList<Color>();
Expand Down Expand Up @@ -335,7 +335,7 @@ public String getHighChartValue() throws HighChartsException {

//Set Subtitle if any was given
builder.append(", subtitle: { ");
if (getTitle() != null) {
if (getSubTitle() != null) {
builder.append("text: '" + subTitle + "'");
} else {
builder.append("text: null");
Expand Down
6 changes: 5 additions & 1 deletion highchartsapi/src/main/resources/Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### Version 1.5
- Basic Functionality.
+ Basic Functionality.

### Version 1.6
+ Different instantiation (!!!) - Take a look at the Code Samples for further info!
Expand All @@ -18,3 +18,7 @@
+ PieChartPlotOptions (Will defaultly be used when none is set)
+ Changed default chart look & feel
+ Removed xAxis, yAxis components

### Version 1.7.1
+ Axis Component improvements (Axis Title, GridLine Behavior)
+ ChartConfiguration improvements
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public void thisAlwaysPasses() {

@Test
public void getTestHighchartAxis() throws HighChartsException {
Axis testAxis = new Axis();
testAxis.setAxisType(Axis.AxisType.xAxis);
Axis testAxis = new Axis(Axis.AxisType.xAxis);
testAxis.setLineWidth(2);
testAxis.setLineColor(Color.BLUE);
testAxis.getCategories().add("Fruits");
Expand Down

0 comments on commit 784ecd0

Please sign in to comment.