示例#1
0
		void SetupGraph ()
		{
			var theme = CPTTheme.ThemeNamed (CPTTheme.PlainBlackTheme);

			graph = new CPTXYGraph {
				PaddingLeft = 10,
				PaddingRight = 10,
				PaddingTop = 10,
				PaddingBottom = 10,
				Title = "Click to Toggle Range Plot Style",

				TitleTextStyle = new CPTMutableTextStyle {
					FontSize = 18,
					FontName = "Helvetica",
					Color = CPTColor.GrayColor
				},

				TitleDisplacement = new PointF (0, -20f)
			};
			graph.ApplyTheme (theme);

			// Store area fill for use later
			var transparentGreen = CPTColor.GreenColor;
			areaFill = new CPTFill (transparentGreen.ColorWithAlphaComponent(0.2f));

			graph.DefaultPlotSpace.ShouldHandlePointingDeviceUp = delegate {
				var rangePlot = (CPTRangePlot) graph.PlotWithIdentifier((NSString)"Date Plot");
				// TODO: instead of areaFillDefault -> null (see code below in comment
				rangePlot.AreaFill = (rangePlot.AreaFill == areaFill ? areaFillDefault : areaFill);
				rangePlot.BarLineStyle = (rangePlot.BarLineStyle == barLineStyleDefault ? barLineStyle: barLineStyleDefault);
				return false;
			};
		}
示例#2
0
        void SetupGraph()
        {
            var theme = CPTTheme.ThemeNamed(CPTTheme.PlainBlackTheme);

            graph = new CPTXYGraph {
                PaddingLeft   = 10,
                PaddingRight  = 10,
                PaddingTop    = 10,
                PaddingBottom = 10,
                Title         = "Click to Toggle Range Plot Style",

                TitleTextStyle = new CPTMutableTextStyle {
                    FontSize = 18,
                    FontName = "Helvetica",
                    Color    = CPTColor.GrayColor
                },

                TitleDisplacement = new PointF(0, -20f)
            };
            graph.ApplyTheme(theme);

            // Store area fill for use later
            var transparentGreen = CPTColor.GreenColor;

            areaFill = new CPTFill(transparentGreen.ColorWithAlphaComponent(0.2f));

            graph.DefaultPlotSpace.ShouldHandlePointingDeviceUp = delegate {
                var rangePlot = (CPTRangePlot)graph.PlotWithIdentifier((NSString)"Date Plot");
                // TODO: instead of areaFillDefault -> null (see code below in comment
                rangePlot.AreaFill     = (rangePlot.AreaFill == areaFill ? areaFillDefault : areaFill);
                rangePlot.BarLineStyle = (rangePlot.BarLineStyle == barLineStyleDefault ? barLineStyle: barLineStyleDefault);
                return(false);
            };
        }