Exemple #1
0
 /// <summary>
 /// Initializes the control properties.
 /// </summary>
 protected void SetupControl()
 {
     if (StopProcessing)
     {
         // Do nothing
     }
     else
     {
         string[] items = ChartName.Split(';');
         if ((items != null) && (items.Length == 2))
         {
             ucGraph.Parameter         = items[0] + "." + items[1];
             ucGraph.ReportItemName    = items[0] + ";" + items[1];
             ucGraph.CacheItemName     = CacheItemName;
             ucGraph.CacheMinutes      = CacheMinutes;
             ucGraph.CacheDependencies = CacheDependencies;
             ucGraph.Width             = Width;
             ucGraph.Height            = Height;
             ucGraph.ItemType          = ReportItemType.Graph;
             ucGraph.LoadDefaultParameters(ParametersXmlData, ParametersXmlSchema);
             ucGraph.RangeInterval      = RangeInterval;
             ucGraph.RangeValue         = RangeValue;
             ucGraph.EnableExport       = EnableExport;
             ucGraph.EnableSubscription = EnableSubscription;
             ucGraph.IsLiveSite         = (CMSContext.ViewMode == ViewModeEnum.LiveSite);
         }
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ChartNameList.Items[0].Selected = true;
            }

            ChartName = ChartNameList.SelectedValue;
            Title     = "Scroll Charts - " + ChartName;

            staticChart.FileName  = ChartName + ".swf";
            dynamicChart.FileName = ChartName + ".swf";

            staticChart.DataUrl  = "Data.xml";
            dynamicChart.DataUrl = "~/Charts/DataHandlers/CombinationChartDataHandler.ashx?FactoryId=2";

            if (ChartName.Contains("LineDY"))
            {
                staticChart.DataUrl = "LineDual.xml";
            }

            if (ChartName == "ScrollCombiDY2D")
            {
                staticChart.DataUrl  = "MultiSeriesStackedData.xml";
                dynamicChart.DataUrl = "~/Charts/DataHandlers/MultiSeriesStackedChartDataHandler.ashx?FactoryId=2&LineDual=1";
            }
        }
        public byte[] Chart(ChartName name, string type, int daysNumber)
        {
            ServiceDatabaseModels.TypeOfMeteorologyData typeOfChart = ServiceDatabaseModels.TypeOfMeteorologyData.Tempreture;
            switch (name)
            {
            case ChartName.Temperature:
            {
                this.chartDescription = new ChartDescription(700, 700, "Temperature chart", "Time [h]", "Temperature [oC]", type);
                typeOfChart           = ServiceDatabaseModels.TypeOfMeteorologyData.Tempreture;
                break;
            }

            case ChartName.Humidity:
            {
                this.chartDescription = new ChartDescription(700, 700, "Humidity chart", "Time [h]", "Humidity [%]", type);
                typeOfChart           = ServiceDatabaseModels.TypeOfMeteorologyData.Humidity;
                break;
            }

            case ChartName.Pressure:
            {
                this.chartDescription = new ChartDescription(700, 700, "Pressure chart", "Time [h]", "Pressure [hPa]", type);
                typeOfChart           = ServiceDatabaseModels.TypeOfMeteorologyData.Pressure;
                break;
            }
            }
            return(GenerateChart(chartDescription, daysNumber, typeOfChart));
        }
        public void InitLanotaTheme(AskForLanotaSetting setting, bool isInit = true)
        {
            //Ready for Init, change Fullscreen canvas mode
            FullScreenCanvas.GetComponent <Canvas>().renderMode = RenderMode.ScreenSpaceOverlay;

            GameObject textcolor, textlevel, textname, reff;

            //Scale
            ChartDesigner.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, 275);

            //Remove Default Element
            Header.GetComponent <Image>().overrideSprite = Res.Sprite_TopBar;
            Copyright.GetComponent <Text>().color        = Color.clear;

            //Font
            ChartName.GetComponent <Text>().font = Res.Font_Kawoszeh;
            ChartDesigner_Placeholder.GetComponent <Text>().font = Res.Font_Kawoszeh;
            ChartDesigner_Text.GetComponent <Text>().font        = Res.Font_Kawoszeh;

            //Text Setting
            ChartName.GetComponent <Text>().fontSize = 19;
            ChartName.GetComponent <Text>().color    = cLanotaText;
            ChartDesigner_Placeholder.GetComponent <Text>().color = cLanotaText;
            ChartDesigner_Text.GetComponent <Text>().color        = cLanotaText;
            if (isInit)
            {
                ChartName.GetComponent <RectTransform>().anchoredPosition += Vector2.left * -60.0F;
            }

            //Create Prefab Object (only first) and position
            if (isInit)
            {
                reff      = GameObject.Instantiate(Res.Prefab_LanotaHeader, Header.transform, false);
                reff.name = "LanotaHeader";
                reff.transform.SetAsFirstSibling();//change render order textcolor->text
            }

            textname  = GameObject.Find("LanotaHeader/DifficultyGlow/TextName");
            textlevel = GameObject.Find("LanotaHeader/DifficultyGlow/TextLevel");
            textcolor = GameObject.Find("LanotaHeader/DifficultyGlow");

            //Change Color of TextGlow
            var nColor = Color.white;

            switch (setting.DifficaltyType)
            {
            case 0:     //invisible
                nColor = Color.clear;
                break;

            case 1:
                nColor = cWhisper;
                break;

            case 2:
                nColor = cAcoustic;
                break;

            case 3:
                nColor = cUltra;
                break;

            case 4:
                nColor = cMaster;
                break;

            case 5:     //custom
                nColor = new Color(setting.DifficaltyR, setting.DifficaltyG, setting.DifficaltyB, 1.0f);
                break;
            }
            textcolor.GetComponent <Image>().color = nColor;

            //Difficalty Name/Level
            var textdiff = setting.Difficalty.Split(';');

            if (textdiff.Length >= 2)
            {
                textname.GetComponent <Text>().text  = textdiff[0];
                textlevel.GetComponent <Text>().text = textdiff[1];
            }
            else
            {
                textname.GetComponent <Text>().text = setting.Difficalty;
            }

            FullScreenCanvas.GetComponent <Canvas>().renderMode = RenderMode.ScreenSpaceCamera;
        }