Hello, Im using sentinel theme and layout.
But my charts are not formatting like the dashboard samples...
Can you help me ?
<p:chart type="line" responsive="true"
model="#{bIGeralController.modeloEntidadesCadastradas}" />
I'm just using this way.
regards.
Theme is not appling to charts
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
I think you can override Extender function.
Dashboard Exp;
XHTML
chartView.java
Extender JS
Dashboard Exp;
XHTML
Code: Select all
<p:chart type="line" model="#{chartView.lineModel}" style="height:300px;margin-top:10px" responsive="true"/>
Code: Select all
...
private void initLinearModel() {
lineModel = new LineChartModel();
lineModel.setTitle("Linear Chart");
lineModel.setLegendPosition("e");
lineModel.setExtender("skinChart");
lineModel.setAnimate(true);
Axis yAxis = lineModel.getAxis(AxisType.Y);
yAxis.setMin(0);
yAxis.setMax(10);
LineChartSeries series1 = new LineChartSeries();
series1.setLabel("Series 1");
series1.set(1, 2);
series1.set(2, 1);
series1.set(3, 3);
series1.set(4, 6);
series1.set(5, 8);
LineChartSeries series2 = new LineChartSeries();
series2.setLabel("Series 2");
series2.set(1, 6);
series2.set(2, 3);
series2.set(3, 2);
series2.set(4, 7);
series2.set(5, 9);
lineModel.addSeries(series1);
lineModel.addSeries(series2);
}
...
Code: Select all
function skinChart() {
this.cfg.shadow = false;
this.cfg.seriesColors = ['#dae8ef', '#27aae1'];
this.cfg.grid = {
background: '#f3f5f7',
borderColor: '#e5ebf0',
gridLineColor: '#e5ebf0',
shadow: false
};
this.cfg.axesDefaults = {
rendererOptions: {
textColor: '#9fadb5'
}
};
this.cfg.seriesDefaults = {
shadow: false,
markerOptions: {
shadow: false
}
}
}
Github Profile: https://github.com/mertsincan
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
I think you can use setTickAngle function;
//java
//java
Code: Select all
private void initLinearModel() {
lineModel = new LineChartModel();
lineModel.setTitle("Linear Chart");
lineModel.setLegendPosition("e");
lineModel.setExtender("skinChart");
lineModel.setAnimate(true);
Axis yAxis = lineModel.getAxis(AxisType.Y);
yAxis.setMin(0);
yAxis.setMax(10);
Axis xAxis = lineModel.getAxis(AxisType.X);
xAxis.setTickAngle(-30); // add angle
LineChartSeries series1 = new LineChartSeries();
series1.setLabel("Series 1");
series1.set(1, 2);
series1.set(2, 1);
series1.set(3, 3);
series1.set(4, 6);
series1.set(5, 8);
LineChartSeries series2 = new LineChartSeries();
series2.setLabel("Series 2");
series2.set(1, 6);
series2.set(2, 3);
series2.set(3, 2);
series2.set(4, 7);
series2.set(5, 9);
lineModel.addSeries(series1);
lineModel.addSeries(series2);
}
Code: Select all
function skinChart() {
this.cfg.shadow = false;
this.cfg.seriesColors = ['#dae8ef', '#27aae1'];
this.cfg.grid = {
background: '#f3f5f7',
borderColor: '#e5ebf0',
gridLineColor: '#e5ebf0',
shadow: false
};
var newTickOptions = {textColor: '#9fadb5'};
$.extend( this.cfg.axes.xaxis.tickOptions, newTickOptions );
$.extend( this.cfg.axes.yaxis.tickOptions, newTickOptions );
this.cfg.seriesDefaults = {
shadow: false,
markerOptions: {
shadow: false
}
}
}
Github Profile: https://github.com/mertsincan
Hello.
When I update last version from Sentinel. Charts are not more responsive.
when I collapse the left menu, charts are not reploting and losing the position.
I look the others themes and just Icarus is doing this correctly.
Anyone can help me ??
Regards...
When I update last version from Sentinel. Charts are not more responsive.
when I collapse the left menu, charts are not reploting and losing the position.
I look the others themes and just Icarus is doing this correctly.
Anyone can help me ??
Regards...
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Please add the following fix into layout.js;
Code: Select all
...
toggleLeftMenu: function() {
...
$(window).trigger('resize'); /* Please add */
},
...
Github Profile: https://github.com/mertsincan
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
setOptions ??? Could you please attach a sample xhtml page and bean for us?
Github Profile: https://github.com/mertsincan
-
- Information
-
Who is online
Users browsing this forum: No registered users and 2 guests