javafx 图表css,如何在CSS中的第7个系列之上更改javaFX LineChart中的图标?
我正在绘制几个系列的图表,但我只能用css个性化第7个系列。从第8行开始,它返回到默认颜色0设置。有人能帮我吗?如何在CSS中的第7个系列之上更改javaFX LineChart中的图标?
CSS代码:
.default-color0.chart-series-line {
-fx-stroke: transparent;
}
.default-color0.chart-line-symbol {
-fx-background-color: transparent, transparent;
}
.default-color3.chart-series-line {
-fx-stroke: transparent;
}
.default-color3.chart-line-symbol{
-fx-shape: "M0,1 L0,2 L1,2 L1,3 L2,3 L2,2 L3,2 L3,1 L2,1 L2,0 L1,0 L1,2 z"; /* <= Esse é para cruz */
-fx-background-color: blue, blue;
}
.default-color4.chart-series-line {
-fx-stroke: transparent;
}
.default-color4.chart-line-symbol{
-fx-shape: "M0,4 L4,4 L4,0 L0,0 Z"; /* <= esse é para quadrado*/
}
.default-color5.chart-series-line {
-fx-stroke: transparent;
}
.default-color5.chart-line-symbol{
-fx-shape: "M0,4 L2,0 L4,4 Z"; /* <= esse é para triangulo*/
}
.default-color6.chart-series-line {
-fx-stroke: transparent;
}
.default-color6.chart-line-symbol{
-fx-shape: "M0,1 L0,2 L1,2 L1,3 L2,3 L2,2 L3,2 L3,1 L2,1 L2,0 L1,0 L1,2 z"; /* <= Esse é para cruz */
-fx-background-color: red, red;
}
.default-color7.chart-series-line {
-fx-stroke: transparent;
}
.default-color7.chart-line-symbol{
-fx-shape: "M1,3 L0,1 L0,0 L1,0 L1,1 L2,1 L2,0 L3,0 L3,1 L2,3 z"; /* <= Esse é para coracao */
-fx-border-color: rosybrown;
-fx-background-color: rosybrown, rosybrown;
}
.default-color8.chart-series-line {
-fx-stroke: transparent;
}
.default-color8.chart-line-symbol{
-fx-shape: "M1,3 L0,1 L0,0 L1,0 L1,1 L2,1 L2,0 L3,0 L3,1 L2,3 z"; /* <= Esse é para coracao */
-fx-border-color: green;
-fx-background-color: green, green;
}
Java代码:
private void putDataChart(String cns){
try{
// Atention: the first serie is 'base' (dont show in the chart),
// the second and the third ones shows the lines and de plots (Max and Min Artherial Pressure (AP))
// after that all the lines are transparent and shows only the plots.
// I could't go after the 7th serie becouse its repeats from the zero
// i dont know why.
// to change this settings you have to change the chart.css
chartPA.getData().clear();
List eventos = eADO.getAllEvents(cns);
if (eventos == null) return; // get out if there is no events to show.
XYChart.Series paMaxSerie = new XYChart.Series<>();
XYChart.Series paMinSerie = new XYChart.Series<>();
XYChart.Series consultas = new XYChart.Series<>();
XYChart.Series grupos = new XYChart.Series<>();
XYChart.Series exames = new XYChart.Series<>();
XYChart.Series emergencias = new XYChart.Series<>();
XYChart.Series base = new XYChart.Series<>();
XYChart.Series risco = new XYChart.Series<>();
XYChart.Series teste = new XYChart.Series<>(); //this series isnt showing .default-color8.chart-line-symbol
paMinSerie.setName("PA min");
paMaxSerie.setName("PA max");
consultas.setName("Consulta");
grupos.setName("Grupo");
exames.setName("Exames");
emergencias.setName("Emergências");
base.setName("Legenda:");
risco.setName("Risco CardioVascular");
teste.setName("8th Serie");
LocalDateTime oldestDate = LocalDateTime.now().minusDays(1);
for (Document ev : eventos) {
LocalDateTime ldt = LocalDateTime.from(ev.getDate("date").toInstant().atOffset(ZoneOffset.UTC));
Duration dura = Duration.between(oldestDate,ldt);
if (dura.toDays() < 0){
oldestDate = LocalDateTime.from(ev.getDate("date").toInstant().atOffset(ZoneOffset.UTC));
}
String tipoEvento = ev.getString("tipo");
LocalDate date = LocalDate.from(ev.getDate("date").toInstant().atOffset(ZoneOffset.UTC));
if (tipoEvento.equals("CONSULTA")) { // CONSULTA = Medical Appointment in portuguese
consultas.getData().add(new XYChart.Data<>(date.toString(),10));
} else if (tipoEvento.equals("GRUPOHAS")) { // = Hypertension group
grupos.getData().add(new XYChart.Data<>(date.toString(),20));
} else if (tipoEvento.equals("EXAMES")) {
exames.getData().add(new XYChart.Data<>(date.toString(),30));
} else if (tipoEvento.equals("CVRisk")) {
risco.getData().add(new XYChart.Data<>(date.toString(),200));
} else if (tipoEvento.equals("EMERGENCIA")) {
emergencias.getData().add(new XYChart.Data<>(date.toString(),50));
} else if (tipoEvento.contains("PA")) { // = AP
paMinSerie.getData().add(new XYChart.Data<>(date.toString(),ev.getInteger("MIN")));
paMaxSerie.getData().add(new XYChart.Data<>(date.toString(),ev.getInteger("MAX")));
}
}
Long baseDays = Duration.between(oldestDate, LocalDateTime.now()).toDays();
for (long i = 0; i < baseDays; i++){
LocalDate nextDay = oldestDate.plusDays(i).toLocalDate();
base.getData().add(new XYChart.Data<>(nextDay.toString(),0));
}
chartPA.setVerticalGridLinesVisible(false);
chartPA.getData().add(base);
chartPA.getData().addAll(paMaxSerie, paMinSerie, consultas, grupos,
exames, emergencias, risco, teste);
} catch (Exception putz){
ApoiosMongoADO.arquivaErro("Erro em HasFXMLController.putDataChart(cns)", putz);
}
}
javafx 图表css,如何在CSS中的第7个系列之上更改javaFX LineChart中的图标?相关推荐
- js中html标签变文字颜色,javascript – 更改contenteditable div中文本的颜色
您可以使用HTML编辑API来处理此类用例.参考这里: https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html 简而言之,使用execComm ...
- css链接样式_如何在CSS中设置链接样式
css链接样式 样式链接 (Styling Links) Links can be styled with any CSS property, such as color, font-family, ...
- 中维报警邮件服务器,主打智能分析,中维世纪智能先锋系列产品来了!
原标题:主打智能分析,中维世纪智能先锋系列产品来了! 中维世纪智能先锋系列产品主打"智能分析",包含JVS-C-BP1H2M-AG.JVS-C-BP1H2M-PG(支持POE).J ...
- css在兼容模式下无法引用_如何在CSS中使用深色模式
css在兼容模式下无法引用 by Frank Lämmer 由FrankLämmer 如何在CSS中使用深色模式 (How to get dark mode working with CSS) I h ...
- css中 media的用法,如何在css中正确使用@media
如何在css中使用@media作为特定分辨率?所以我想让我的侧栏更改取决于用户分辨率,所以我使用@media.如何在css中正确使用@media 这是示例代码: @media (max-width: ...
- 如何在 CSS 中设置组件在浏览器屏幕水平垂直居中
如何在 CSS 中设置组件在浏览器屏幕水平垂直居中 在 CSS 中设置组件在浏览器屏幕水平垂直居中可分解为两个问题,一是设置组件在其父组件的水平垂直居中,二是让其父组件铺满整个屏幕. 对于让最 ...
- JavaFX技巧12:在CSS中定义图标
当您是像我这样来自Swing的UI开发人员时,您很有可能仍在代码中直接设置图像/图标. 最可能是这样的: import javafx.scene.control.Label; import javaf ...
- html图片定位代码怎么写,如何在css中设置插入图片定位
在做网页开发时,客户给的素材图片通常都是连在一起的,这样做也是为了缩短响应时间.下面就给大家具体说一下 ,如何通过css属性来定位图片. 如何在css中设置插入图片定位 首先设置固定图片的css属性是 ...
- 如何在CSS中应用多个转换?
本文翻译自:How to apply multiple transforms in CSS? Using CSS, how can I apply more than one transform ? ...
最新文章
- 牛客网 2018年全国多校算法寒假训练营练习比赛(第三场)D.小牛vs小客-博弈
- 人工智能项目开发规划与准备
- CTF -杂项密码学,常见密码介绍(二)
- 都在抢论文第一作者,如何处理?
- Java拦截器,过滤器,监听器(三大器)对比
- amp sqlserver中 什么意思_股票术语中的做空到底是什么意思?
- LNMP详解(十六)——Nginx日志切割
- python map函数1分钟数据生成5分钟_用map函数来完成Python并行任务的简单示例
- 【UIKit】UITableView 5
- 如何最简单把pdf转换word格式
- codeblock的若干使用技巧
- 如何在线ico转jpg格式?如何将ico转换图片格式?
- 字节码层面理解枚举类Enum在switch中的使用
- 蓝桥杯web开发-5道模拟题让你信心满满
- css样式字体文本汇总
- 【SAP】ABAP开发——ALV展示后字段的下划线连接
- 【thinkphp5操作redis系列教程】集合类型之sRem,sRemove
- 计算机一级考试PPT部分几分,计算机一级考试PPT幻灯片和最后一题(就是自己输网址)各有多少分啊...
- 安全测试-短信验证码
- 地理坐标系与投影坐标系的区别(转)