/**********************************************************************
# Copyright (c) EWA Systems Inc. 1998 - 2005 All Rights Reserved
#               No part of this program may be photocopied, reproduced,
#               or translated to another programming language without
#               the prior written consent of EWA Systems.
**********************************************************************/

package com.ewasystems.chart.test;

import java.awt.Color;
import com.ewasystems.chart.AxesXY;
import com.ewasystems.chart.Chart;
import com.ewasystems.chart.ChartData;
import com.ewasystems.chart.JFrameChart;

/**
 * <p>Title: Sample Chart Showing Axes Crossing Control</p>
 * <p>Copyright: (c) 1998 - 2005</p>
 * <p>Company: EWA Systems, Inc.</p>
 * @author Lincoln Evans-Beauchamp
 * @version 1.0
 */

public class SampleAxesCross extends JFrameChart
{
  public SampleAxesCross()
  {
    Chart chart = getChart();

    AxesXY axisLeft = new AxesXY(chart);
    double yLeft[] = {4, 6, 2, 1, 8};
    ChartData dataLeft = new ChartData(axisLeft, yLeft);
    dataLeft.setDataType(ChartData.DATA_TYPE_LINE);
    axisLeft.setLineColor(Color.blue);
    axisLeft.setTextColor(Color.blue);

    AxesXY axisRight = new AxesXY(chart);
    axisRight.setCross(-8,10);
    double xRight[] = {0, 10, 20, 30, 40};
    double yRight[] = {85, 23, 46, 61, 32};
    ChartData dataRight = new ChartData(axisRight, xRight, yRight);
    dataRight.setDataType(ChartData.DATA_TYPE_LINE);
    axisRight.setLineColor(Color.pink);
    axisRight.setTextColor(Color.pink);

    double viewport[] = {0.3, 0.9, 0.3, 0.9};
    axisLeft.setViewport(viewport);
    axisRight.setViewport(viewport);
  }

  public static void main(String argv[])
  {
    new SampleAxesCross().setVisible(true);
  }

  public String toString()
      {return "Sample Axes Cross";}
}
