Beispiel #1
0
        private ChartRecord GenerateNewRecord(int i = 0, double minimum = 0, double maximum = 1)
        {
            var record = new ChartRecord();

            record.Date  = DateTime.UtcNow.AddSeconds(-i);
            record.Value = GetRandomNumber(minimum, maximum);
            return(record);
        }
Beispiel #2
0
        //CHARTFORMATS

        private static ChartRecord CreateChartRecord(int x, int y, int width, int height)
        {
            ChartRecord r = new ChartRecord();

            r.X      = (x);
            r.Y      = (y);
            r.Width  = (width);
            r.Height = (height);
            return(r);
        }
Beispiel #3
0
        public void TestLoad()
        {
            ChartRecord record = new ChartRecord(TestcaseRecordInputStream.Create((short)0x1002, data));

            Assert.AreEqual(0, record.X);
            Assert.AreEqual(0, record.Y);
            Assert.AreEqual(30474216, record.Width);
            Assert.AreEqual(15060168, record.Height);


            Assert.AreEqual(20, record.RecordSize);
        }
Beispiel #4
0
        public void TestLoad()
        {

            ChartRecord record = new ChartRecord(TestcaseRecordInputStream.Create((short)0x1002,  data));
            Assert.AreEqual(0, record.X);
            Assert.AreEqual(0, record.Y);
            Assert.AreEqual(30474216, record.Width);
            Assert.AreEqual(15060168, record.Height);


            Assert.AreEqual(20, record.RecordSize);
        }
Beispiel #5
0
        public void TestStore()
        {
            ChartRecord record = new ChartRecord();
            record.X=(0);
            record.Y=(0);
            record.Width=(30474216);
            record.Height=(15060168);


            byte[] recordBytes = record.Serialize();
            Assert.AreEqual(recordBytes.Length - 4, data.Length);
            for (int i = 0; i < data.Length; i++)
                Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
        }
Beispiel #6
0
        public void TestStore()
        {
            ChartRecord record = new ChartRecord();

            record.X      = (0);
            record.Y      = (0);
            record.Width  = (30474216);
            record.Height = (15060168);


            byte[] recordBytes = record.Serialize();
            Assert.AreEqual(recordBytes.Length - 4, data.Length);
            for (int i = 0; i < data.Length; i++)
            {
                Assert.AreEqual(data[i], recordBytes[i + 4], "At offset " + i);
            }
        }
Beispiel #7
0
 private ChartRecord CreateChartRecord(int x, int y, int width, int height)
 {
     ChartRecord r = new ChartRecord();
     r.X = (x);
     r.Y = (y);
     r.Width = (width);
     r.Height = (height);
     return r;
 }
Beispiel #8
0
 private HSSFChart(HSSFSheet sheet, ChartRecord chartRecord)
 {
     this.chartRecord = chartRecord;
     this.sheet = sheet;
 }
        public ChartFormatsAggregate(RecordStream rs, ChartRecordAggregate container)
            : base(RuleName_CHARTFOMATS, container)
        {
            Debug.Assert(rs.PeekNextChartSid() == ChartRecord.sid);
            chart = (ChartRecord)rs.GetNext();
            rs.GetNext();
            while (rs.PeekNextChartSid() == FrtFontListRecord.sid)
            {
                fontList.Add(new FontListAggregate(rs, this));
            }
            Debug.Assert(rs.PeekNextChartSid() == SCLRecord.sid);
            scl        = (SCLRecord)rs.GetNext();
            plotGrowth = (PlotGrowthRecord)rs.GetNext();

            if (rs.PeekNextChartSid() == FrameRecord.sid)
            {
                frame = new FrameAggregate(rs, this);
            }

            while (rs.PeekNextChartSid() == SeriesRecord.sid)
            {
                seriesFormatList.Add(new SeriesFormatAggregate(rs, this));
            }

            while (rs.PeekNextChartSid() == DataFormatRecord.sid)
            {
                ssList.Add(new SSAggregate(rs, this));
            }

            Debug.Assert(rs.PeekNextChartSid() == ShtPropsRecord.sid);
            shtProps = (ShtPropsRecord)rs.GetNext();

            while (rs.PeekNextChartSid() == DefaultTextRecord.sid ||
                   rs.PeekNextChartSid() == DataLabExtRecord.sid)
            {
                dftTextList.Add(new DFTTextAggregate(rs, this));
            }

            Debug.Assert(rs.PeekNextChartSid() == AxesUsedRecord.sid);
            axesUsed = (AxesUsedRecord)rs.GetNext();

            Debug.Assert(rs.PeekNextChartSid() == AxisParentRecord.sid);
            axisParent1 = new AxisParentAggregate(rs, this);
            if (rs.PeekNextChartSid() == AxisParentRecord.sid)
            {
                axisParent2 = new AxisParentAggregate(rs, this);
            }

            if (rs.PeekNextChartSid() == CrtLayout12ARecord.sid)
            {
                crt12A = (CrtLayout12ARecord)rs.GetNext();
            }
            if (rs.PeekNextChartSid() == DatRecord.sid)
            {
                dat = new DatAggregate(rs, container);
            }

            if (rs.PeekNextChartSid() == TextRecord.sid)
            {
                while (rs.PeekNextChartSid() == TextRecord.sid)
                {
                    attachedLabelList.Add(new AttachedLabelAggregate(rs, this));
                }
            }

            if (rs.PeekNextChartSid() == CrtMlFrtRecord.sid)
            {
                crtMlFrt = new CrtMlFrtAggregate(rs, container);
            }

            while (rs.PeekNextChartSid() == DataLabExtRecord.sid || rs.PeekNextChartSid() == TextRecord.sid)
            {
                cfalList.Add(new ChartFormatsAttachedLabelAggregate(rs, this));
            }

            if (rs.PeekNextChartSid() == TextPropsStreamRecord.sid)
            {
                textProps = new TextPropsAggregate(rs, container);
            }

            while (rs.PeekNextChartSid() == CrtMlFrtRecord.sid)
            {
                mlfrtList.Add(new CrtMlFrtAggregate(rs, container));
            }

            Record r = rs.GetNext();//EndRecord

            Debug.Assert(r.GetType() == typeof(EndRecord));
        }
Beispiel #10
0
	private ChartRecord CreateChartRecord( int x, int y, int width, int height )
	{
		ChartRecord r = new ChartRecord();
		r.SetX( x );
		r.SetY( y );
		r.SetWidth( width );
		r.SetHeight( height );
		return r;
	}