All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.zavtech.morpheus.viz.chart.ChartData Maven / Gradle / Ivy

There is a newer version: 0.9.21
Show newest version
/**
 * Copyright (C) 2014-2017 Xavier Witdouck
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.zavtech.morpheus.viz.chart;

import com.zavtech.morpheus.frame.DataFrame;

/**
 * An interface used to manage datasets that are bound to a chart
 *
 * @author  Xavier Witdouck
 *
 * 

This is open source software released under the Apache 2.0 License

*/ public interface ChartData { /** * Clears all data from the chart */ void removeAll(); /** * Removes the data at the specified index * @param index the index of the dataset to remove */ void remove(int index); /** * Sets the range axis to use for the dataset specified * @param dataset the dataset index * @param axis tne range axis index, 0 for primary, 1 for secondary * @return this data interface */ ChartData setRangeAxis(int dataset, int axis); /** * Returns the chart model holding chart data at the specified index * @param index the index for requested data * @param the series key type * @return the chart model for index, null if no data for index */ ChartModel at(int index); /** * Adds a data frame using the row keys to define the domain * @param frame the data frame containing chart data where columns represent series * @param the series key type * @return the index assigned to the newly added dataset */ ChartModel add(DataFrame frame); /** * Adds a data frame using a specific column in the frame to define the domain axis * @param frame the data frame containing chart data where column represent series, except for column with domainKey * @param domainKey the column key that should be used to define the domain * @param the series key type * @return the index assigned to the newly added dataset */ ChartModel add(DataFrame frame, S domainKey); /** * Applies an updated DataFrame to the model at the specified index * @param index the index of the data model to update with the specified frame * @param frame the data frame containing chart data where columns represent series * @param the series key type * @return the index assigned to the newly added dataset */ ChartModel update(int index, DataFrame frame); /** * Applies an updated DataFrame to the model at the specified index * @param index the index of the data model to update with the specified frame * @param frame the data frame containing chart data where column represent series, except for column with domainKey * @param domainKey the column key that should be used to define the domain * @param the series key type * @return the index assigned to the newly added dataset */ ChartModel update(int index, DataFrame frame, S domainKey); }