本文整理汇总了Java中org.jfree.data.general.Dataset类的典型用法代码示例。如果您正苦于以下问题:Java Dataset类的具体用法?Java Dataset怎么用?Java Dataset使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Dataset类属于org.jfree.data.general包,在下文中一共展示了Dataset类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDataset
import org.jfree.data.general.Dataset; //导入依赖的package包/类
public Dataset createDataset(boolean async) {
try {
ResultSet rs = getResultSet(async);
if (rs == null) {
logger.debug("Returning null data set because getResultSet() returned null");
return null;
}
// Need to update chart columns from the new ResultSet before using them.
syncWithRs(rs);
switch (type.getDatasetType()) {
case CATEGORY:
return DatasetUtil.createCategoryDataset(
chartColumns, rs,
findRoleColumns(ColumnRole.CATEGORY));
case XY:
return DatasetUtil.createSeriesCollection(
chartColumns, rs);
default :
throw new IllegalStateException("Unknown chart type " + type);
}
} catch (SQLException e) {
throw new RuntimeException(e);
}
}
示例2: createChart
import org.jfree.data.general.Dataset; //导入依赖的package包/类
@Override
protected JFreeChart createChart(String title, Dataset dataset) {
JFreeChart chart = ChartFactory.createBoxAndWhiskerChart(title, X_AXIS_LABEL, getYAxisLabel(), (BoxAndWhiskerCategoryDataset) dataset, false);
CategoryPlot p = chart.getCategoryPlot();
p.setForegroundAlpha(0.5f);
p.setBackgroundPaint(Color.lightGray);
p.setDomainGridlinesVisible(true);
p.setDomainGridlinePaint(Color.white);
p.setRangeGridlinesVisible(true);
p.setRangeGridlinePaint(Color.white);
BoxAndWhiskerRenderer renderer = (BoxAndWhiskerRenderer)p.getRenderer();
renderer.setSeriesPaint(0, new Color(40,234,115));
renderer.setMeanVisible(false);
return chart;
}
示例3: createChart
import org.jfree.data.general.Dataset; //导入依赖的package包/类
@Override
protected JFreeChart createChart(String title, Dataset dataset) {
JFreeChart chart = ChartFactory.createBarChart( title, X_AXIS_LABEL, getYAxisLabel(),
(CategoryDataset) dataset, PlotOrientation.VERTICAL,
false, false, false
);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
BarRenderer renderer = (BarRenderer) plot.getRenderer();
renderer.setDrawBarOutline(false);
// set up gradient paints for series...
final GradientPaint gp0 = new GradientPaint(
0.0f, 0.0f, Color.blue,
0.0f, 0.0f, Color.lightGray
);
renderer.setSeriesPaint(0, gp0);
return chart;
}
示例4: readObject
import org.jfree.data.general.Dataset; //导入依赖的package包/类
/**
* Provides serialization support.
*
* @param stream the input stream.
*
* @throws IOException if there is an I/O error.
* @throws ClassNotFoundException if there is a classpath problem.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.angleGridlineStroke = SerialUtilities.readStroke(stream);
this.angleGridlinePaint = SerialUtilities.readPaint(stream);
this.radiusGridlineStroke = SerialUtilities.readStroke(stream);
this.radiusGridlinePaint = SerialUtilities.readPaint(stream);
this.angleLabelPaint = SerialUtilities.readPaint(stream);
int rangeAxisCount = this.axes.size();
for (int i = 0; i < rangeAxisCount; i++) {
Axis axis = (Axis) this.axes.get(i);
if (axis != null) {
axis.setPlot(this);
axis.addChangeListener(this);
}
}
int datasetCount = this.datasets.size();
for (int i = 0; i < datasetCount; i++) {
Dataset dataset = (Dataset) this.datasets.get(i);
if (dataset != null) {
dataset.addChangeListener(this);
}
}
int rendererCount = this.renderers.size();
for (int i = 0; i < rendererCount; i++) {
PolarItemRenderer renderer = (PolarItemRenderer) this.renderers.get(i);
if (renderer != null) {
renderer.addChangeListener(this);
}
}
}
示例5: readObject
import org.jfree.data.general.Dataset; //导入依赖的package包/类
/**
* Provides serialization support.
*
* @param stream the input stream.
*
* @throws IOException if there is an I/O error.
* @throws ClassNotFoundException if there is a classpath problem.
*/
private void readObject(ObjectInputStream stream)
throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.angleGridlineStroke = SerialUtils.readStroke(stream);
this.angleGridlinePaint = SerialUtils.readPaint(stream);
this.radiusGridlineStroke = SerialUtils.readStroke(stream);
this.radiusGridlinePaint = SerialUtils.readPaint(stream);
this.angleLabelPaint = SerialUtils.readPaint(stream);
int rangeAxisCount = this.axes.size();
for (int i = 0; i < rangeAxisCount; i++) {
Axis axis = (Axis) this.axes.get(i);
if (axis != null) {
axis.setPlot(this);
axis.addChangeListener(this);
}
}
int datasetCount = this.datasets.size();
for (int i = 0; i < datasetCount; i++) {
Dataset dataset = (Dataset) this.datasets.get(i);
if (dataset != null) {
dataset.addChangeListener(this);
}
}
int rendererCount = this.renderers.size();
for (int i = 0; i < rendererCount; i++) {
PolarItemRenderer renderer = (PolarItemRenderer) this.renderers.get(i);
if (renderer != null) {
renderer.addChangeListener(this);
}
}
}
示例6: resolveEntityProvider
import org.jfree.data.general.Dataset; //导入依赖的package包/类
protected ChartHyperlinkProvider resolveEntityProvider(ChartEntity entity)
{
ChartHyperlinkProvider provider = null;
Dataset dataset = getEntityDataset(entity);
if (dataset != null)
{
provider = datasetProviders.get(dataset);
}
return provider;
}
示例7: getEntityDataset
import org.jfree.data.general.Dataset; //导入依赖的package包/类
protected Dataset getEntityDataset(ChartEntity entity)
{
Dataset dataset = null;
if (entity instanceof CategoryItemEntity)
{
dataset = ((CategoryItemEntity) entity).getDataset();
}
else if (entity instanceof XYItemEntity)
{
dataset = ((XYItemEntity) entity).getDataset();
}
return dataset;
}
示例8: getCustomDataset
import org.jfree.data.general.Dataset; //导入依赖的package包/类
@Override
public Dataset getCustomDataset()
{
TimePeriodValuesCollection dataset = new TimePeriodValuesCollection();
if (seriesNames != null)
{
for(int i = 0; i < seriesNames.size(); i++)
{
Comparable<?> seriesName = seriesNames.get(i);
dataset.addSeries(seriesMap.get(seriesName));
}
}
return dataset;
}
示例9: getCustomDataset
import org.jfree.data.general.Dataset; //导入依赖的package包/类
@Override
public Dataset getCustomDataset()
{
TimeSeriesCollection dataset = new TimeSeriesCollection(getTimeZone());
if (seriesNames != null)
{
for(int i = 0; i < seriesNames.size(); i++)
{
Comparable<?> seriesName = seriesNames.get(i);
dataset.addSeries(seriesMap.get(seriesName));
}
}
return dataset;
}
示例10: getCustomDataset
import org.jfree.data.general.Dataset; //导入依赖的package包/类
@Override
public Dataset getCustomDataset()
{
XYSeriesCollection dataset = new XYSeriesCollection();
if (seriesNames != null)
{
for(int i = 0; i < seriesNames.size(); i++)
{
Comparable<?> seriesName = seriesNames.get(i);
dataset.addSeries(seriesMap.get(seriesName));
}
}
return dataset;
}
示例11: getCustomDataset
import org.jfree.data.general.Dataset; //导入依赖的package包/类
@Override
public Dataset getCustomDataset()
{
TaskSeriesCollection dataset = new TaskSeriesCollection();
if (seriesNames != null)
{
for(int i = 0; i < seriesNames.size(); i++)
{
Comparable<?> seriesName = seriesNames.get(i);
dataset.add(seriesMap.get(seriesName));
}
}
return dataset;
}
示例12: getCustomDataset
import org.jfree.data.general.Dataset; //导入依赖的package包/类
@Override
public Dataset getCustomDataset()
{
int size = elements.size();
if (size > 0)
{
Date[] dateArray = new Date[size];
double[] highArray = new double[size];
double[] lowArray = new double[size];
double[] openArray = new double[size];
double[] closeArray = new double[size];
double[] volumeArray = new double[size];
for (int i = 0; i < elements.size(); i++) {
HighLowElement bean = elements.get(i);
dateArray[i] = new Date(bean.getDate().getTime());
highArray[i] = bean.getHigh().doubleValue();
lowArray[i] = bean.getLow().doubleValue();
openArray[i] = bean.getOpen().doubleValue();
closeArray[i] = bean.getClose().doubleValue();
volumeArray[i] = bean.getVolume().doubleValue();
}
return new DefaultHighLowDataset(series, dateArray, highArray, lowArray, openArray, closeArray, volumeArray);
}
return null;
}
示例13: getDataset
import org.jfree.data.general.Dataset; //导入依赖的package包/类
/**
*
*/
public Dataset getDataset()
{
increment();
return getCustomDataset();
}
示例14: setAsListener
import org.jfree.data.general.Dataset; //导入依赖的package包/类
void setAsListener() {
mDomainAxis.addChangeListener(this);
addAdjustmentListener(this);
Dataset dataset = mPlot.getDataset();
if (dataset != null) {
dataset.addChangeListener(this);
}
updateAxis();
addMouseListener(this);
}
示例15: getDataset
import org.jfree.data.general.Dataset; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public Dataset getDataset() {
Map<String, TimePeriodCollater> seriesToPeriodMap = new HashMap<String, TimePeriodCollater>();
TimeTableXYDataset dataset = new TimeTableXYDataset();
for (ResultsSummary summary : getResultsList())
{
String[] seriesKeys = getSeriesKeys(summary);
if (seriesKeys != null) {
for (int i = 0; (i < seriesKeys.length); i++) {
String key = seriesKeys[i];
Date buildDate = summary.getBuildDate();
TimePeriodCollater collaterForSeries = (TimePeriodCollater) seriesToPeriodMap.get(key);
if (collaterForSeries == null) {
collaterForSeries = createCollater(getPeriod(buildDate, getPeriodRange()), key);
collaterForSeries.addResult(summary);
seriesToPeriodMap.put(key, collaterForSeries);
} else if (isInPeriod(collaterForSeries.getPeriod(), buildDate)) {
collaterForSeries.addResult(summary);
} else {
writeCollaterToDataSet(dataset, collaterForSeries);
RegularTimePeriod nextPeriod = collaterForSeries.getPeriod().next();
while (!isInPeriod(nextPeriod, buildDate)) {
nextPeriod = nextPeriod.next();
}
collaterForSeries = createCollater(nextPeriod, key);
collaterForSeries.addResult(summary);
seriesToPeriodMap.put(key, collaterForSeries);
}
}
}
}
Collection<TimePeriodCollater> finalPeriods = seriesToPeriodMap.values();
TimePeriodCollater timePeriodCollater;
for (Iterator<TimePeriodCollater> iterator = finalPeriods.iterator(); iterator.hasNext(); writeCollaterToDataSet(dataset, timePeriodCollater)) {
timePeriodCollater = iterator.next();
}
return dataset;
}
开发者ID:javiergutites,项目名称:bamboo-checkstyle-plugin,代码行数:39,代码来源:AbstractMultiSeriesTimePeriodCollector.java