Posts

JFreeChart (BarChart, LineChart, PieChart) in Vaadin Flow

// Dependencies <dependency> <groupId> org.jfree </groupId> <artifactId> jfreechart </artifactId> <version> 1.0.19 </version> </dependency> <dependency> <groupId> com.faendir.vaadin </groupId> <artifactId> jfreechart-flow </artifactId> <version> 1.1.6 </version> </dependency> // Source Code public class JFreeChartComponent extends VerticalLayout { private JFreeChart jFreeChart ; private JFreeChartWrapper jFreeChartWrapper ; public JFreeChartComponent () { this .setSizeFull() ; this . jFreeChartWrapper = new JFreeChartWrapper(getPieChart()) ; this .add( jFreeChartWrapper ) ; } private JFreeChart getPieChart () { DefaultPieDataset dataset = new DefaultPieDataset( ) ; dataset.setValue( "IPhone 5s" , new Double( 20 ) ) ; dataset.setValue( "SamSung...
Image
 How to create Custom Toggle Button in Vaadin (flow) // Try this code... // 1). Created custom Toggle Button using Vaadin Flow. // 2). No dependencies. // 3). You can change its color as per your requirement.                  package com.vaadin.ui.customcomponents;         import com.vaadin.flow.component.orderedlayout.HorizontalLayout;         import com.vaadin.flow.component.orderedlayout.VerticalLayout;                  public class CustomToggleButton extends VerticalLayout {                      public static final String UNCHECKED_BACKGROUND_COLOR = "#CCCCCC";             public static final String CHECKED_BACKGROUND_COLOR = "#3375C2";             public static final String CIRCLE_COLOR = "#FFFFFF";           ...