ShinyDashboard: Default theme as shinyDashboardThemeDIY - r
dashboardthemes allows to conveniently build custom themes for shinydashboard through the use of the shinyDashboardThemeDIY function.
On https://github.com/nik01010/dashboardthemes/tree/master/R, I can find the shinyDashboardThemeDIY syntax for all the custom themes used to showcase dashboardthemes there.
However, I'd like to work out of the default theme and customize it, and I cannot find the shinyDashboardThemeDIY syntax for the default shinydashboard, which looks as follows:
Does anyone knows where to find it or has anyone been able to reconstruct it?
To clarify in case there is any confusion, I am looking for a piece of code like the following:
shinyDashboardThemeDIY(
### general
appFontFamily = "Arial"
,appFontColor = "rgb(0,0,0)"
,primaryFontColor = "rgb(0,0,0)"
,infoFontColor = "rgb(0,0,0)"
,successFontColor = "rgb(0,0,0)"
,warningFontColor = "rgb(0,0,0)"
,dangerFontColor = "rgb(0,0,0)"
,bodyBackColor = "rgb(248,248,248)"
### header
,logoBackColor = "rgb(23,103,124)"
,headerButtonBackColor = "rgb(238,238,238)"
,headerButtonIconColor = "rgb(75,75,75)"
,headerButtonBackColorHover = "rgb(210,210,210)"
,headerButtonIconColorHover = "rgb(0,0,0)"
,headerBackColor = "rgb(238,238,238)"
,headerBoxShadowColor = "#aaaaaa"
,headerBoxShadowSize = "2px 2px 2px"
### sidebar
,sidebarBackColor = cssGradientThreeColors(
direction = "down"
,colorStart = "rgb(20,97,117)"
,colorMiddle = "rgb(56,161,187)"
,colorEnd = "rgb(3,22,56)"
,colorStartPos = 0
,colorMiddlePos = 50
,colorEndPos = 100
)
,sidebarPadding = 0
,sidebarMenuBackColor = "transparent"
,sidebarMenuPadding = 0
,sidebarMenuBorderRadius = 0
,sidebarShadowRadius = "3px 5px 5px"
,sidebarShadowColor = "#aaaaaa"
,sidebarUserTextColor = "rgb(255,255,255)"
,sidebarSearchBackColor = "rgb(55,72,80)"
,sidebarSearchIconColor = "rgb(153,153,153)"
,sidebarSearchBorderColor = "rgb(55,72,80)"
,sidebarTabTextColor = "rgb(255,255,255)"
,sidebarTabTextSize = 13
,sidebarTabBorderStyle = "none none solid none"
,sidebarTabBorderColor = "rgb(35,106,135)"
,sidebarTabBorderWidth = 1
,sidebarTabBackColorSelected = cssGradientThreeColors(
direction = "right"
,colorStart = "rgba(44,222,235,1)"
,colorMiddle = "rgba(44,222,235,1)"
,colorEnd = "rgba(0,255,213,1)"
,colorStartPos = 0
,colorMiddlePos = 30
,colorEndPos = 100
)
,sidebarTabTextColorSelected = "rgb(0,0,0)"
,sidebarTabRadiusSelected = "0px 20px 20px 0px"
,sidebarTabBackColorHover = cssGradientThreeColors(
direction = "right"
,colorStart = "rgba(44,222,235,1)"
,colorMiddle = "rgba(44,222,235,1)"
,colorEnd = "rgba(0,255,213,1)"
,colorStartPos = 0
,colorMiddlePos = 30
,colorEndPos = 100
)
,sidebarTabTextColorHover = "rgb(50,50,50)"
,sidebarTabBorderStyleHover = "none none solid none"
,sidebarTabBorderColorHover = "rgb(75,126,151)"
,sidebarTabBorderWidthHover = 1
,sidebarTabRadiusHover = "0px 20px 20px 0px"
### boxes
,boxBackColor = "rgb(255,255,255)"
,boxBorderRadius = 5
,boxShadowSize = "0px 1px 1px"
,boxShadowColor = "rgba(0,0,0,.1)"
,boxTitleSize = 16
,boxDefaultColor = "rgb(210,214,220)"
,boxPrimaryColor = "rgba(44,222,235,1)"
,boxInfoColor = "rgb(210,214,220)"
,boxSuccessColor = "rgba(0,255,213,1)"
,boxWarningColor = "rgb(244,156,104)"
,boxDangerColor = "rgb(255,88,55)"
,tabBoxTabColor = "rgb(255,255,255)"
,tabBoxTabTextSize = 14
,tabBoxTabTextColor = "rgb(0,0,0)"
,tabBoxTabTextColorSelected = "rgb(0,0,0)"
,tabBoxBackColor = "rgb(255,255,255)"
,tabBoxHighlightColor = "rgba(44,222,235,1)"
,tabBoxBorderRadius = 5
### inputs
,buttonBackColor = "rgb(245,245,245)"
,buttonTextColor = "rgb(0,0,0)"
,buttonBorderColor = "rgb(200,200,200)"
,buttonBorderRadius = 5
,buttonBackColorHover = "rgb(235,235,235)"
,buttonTextColorHover = "rgb(100,100,100)"
,buttonBorderColorHover = "rgb(200,200,200)"
,textboxBackColor = "rgb(255,255,255)"
,textboxBorderColor = "rgb(200,200,200)"
,textboxBorderRadius = 5
,textboxBackColorSelect = "rgb(245,245,245)"
,textboxBorderColorSelect = "rgb(200,200,200)"
### tables
,tableBackColor = "rgb(255,255,255)"
,tableBorderColor = "rgb(240,240,240)"
,tableBorderTopSize = 1
,tableBorderRowSize = 1
)
except it reproduces the default theme.
Related
Why do I get error "missing 1 required positional argument"?
Why I continue getting the error : missing 1 required positional argument: 'category_id' when the argument is already passed within query function in Backend class? I also don't understand the error of unfilled self or missing positional argument self: missing 1 required positional argument: 'self' I tried passing self to display_account_types() in Frontend class but it doesn't reflect. Do I need to pass self within the inner nested functions within a class? import tkinter from tkinter import * from tkinter import ttk import tkinter.messagebox import sqlite3 root =Tk() root.title('Simple Application') root.config(bg='SlateGrey') root.geometry("") # BackEnd class Backend(): def __init__(self): self.conn = sqlite3.connect('accounting.db') self.cur = self.conn.cursor() self.conn.execute("""CREATE TABLE IF NOT EXISTS account_type( id INTEGER PRIMARY KEY, category_type INTEGER NOT NULL, category_id TEXT NOT NULL )"""), self.conn.commit() self.conn.close() def insert_account_type(self, category_type, category_id): self.conn = sqlite3.connect('accounting.db') self.cur = self.conn.cursor() self.cur.execute("""INSERT INTO account_type(category_id, category_type) VALUES(?,?);""", (self,category_type, category_id,)) self.conn.commit() self.conn.close() def view_account_type(self): self.conn = sqlite3.connect('accounting.db') self.cur = self.conn.cursor() self.cur.execute("SELECT * FROM account_type") self.rows = self.cur.fetchall() self.conn.close() return self.rows # calling the class tb = Backend() # Front End class Frontend(): def __init__(self, master): # Frames self.top_frame = LabelFrame(master,bg ='SlateGrey', relief=SUNKEN) self.top_frame.pack() self.bottom_frame = LabelFrame(master, bg = 'SlateGrey', relief=SUNKEN) self.bottom_frame.pack() self.right_frame = LabelFrame(self.top_frame, bg = 'SlateGrey', relief = FLAT, text = 'Details Entry',fg = 'maroon') self.right_frame.pack(side = RIGHT, anchor = NE) self.side_frame = LabelFrame(self.top_frame,bg ='SlateGrey',relief=SUNKEN,text = 'Menu Buttons',fg = 'maroon') self.side_frame.pack(side = LEFT,anchor = NW) self.bot_frame = LabelFrame(self.bottom_frame, bg='Grey',relief = SUNKEN,text = 'Field View',fg = 'maroon') self.bot_frame.pack(side = BOTTOM,anchor = SW) # Side Buttons self.btn1 = Button(self.side_frame, text='Main Account Types', bg='SteelBlue4', font=('cambria', 11), anchor=W, fg='white', width=18,height=2, command=lambda :[self.main_account()]) self.btn1.grid(row=0, column=0, pady=0, sticky=W) def main_account(self): # variables self.category_type = StringVar() self.category_id = StringVar() # functions def add_main_accounts(): if self.category_type.get() == "" or self.category_id.get() == "": tkinter.messagebox.showinfo('All fields are required') else: Backend.insert_account_type( self.category_type.get(), self.category_id.get(),) # category type unfilled tkinter.messagebox.showinfo('Entry successful') def display_account_types(self): self.trv.delete(*self.trv.get_children()) for self.rows in Backend.view_account_type(self): self.trv.insert("", END, values=self.rows) def get_account_type(e): self.selected_row = self.trv.focus() self.data = self.trv.item(self.selected_row) global row row = self.data["values"] """Grab items and send them to entry fields""" self.category_id.set(row[1]) self.category_type.set(row[2]) """=================TreeView===============""" # Scrollbars ttk.Style().configure("Treeview", background = "SlateGrey", foreground = "white", fieldbackground = "grey") scroll_x = Scrollbar(self.bot_frame, orient = HORIZONTAL) scroll_x.pack(side = BOTTOM, fill = X) scroll_y = Scrollbar(self.bot_frame, orient = VERTICAL) scroll_y.pack(side = RIGHT, fill = Y) # Treeview columns & setting scrollbars self.trv = ttk.Treeview(self.bot_frame, height=3, columns= ('id', 'category_id', 'category_type'), xscrollcommand = scroll_x.set, yscrollcommand = scroll_y.set) # Treeview style configuration ttk.Style().configure("Treeview", background = "SlateGrey", foreground = "white", fieldbackground = "grey") # Configure vertical and Horizontal scroll scroll_x.config(command = self.trv.xview) scroll_y.config(command = self.trv.yview) # Treeview Headings/columns self.trv.heading('id', text = "No.") self.trv.heading('category_id', text = 'Category ID') self.trv.heading('category_type', text = 'Category Type') self.trv['show'] = 'headings' # Treeview columns width self.trv.column('id', width = 23) self.trv.column('category_id', width = 70) self.trv.column('category_type', width = 100) self.trv.pack(fill = BOTH, expand = YES) # Binding Treeview with data self.trv.bind('<ButtonRelease-1>',get_account_type) # Account Types Labels self.lbl1 = Label(self.right_frame,text = 'Category ID',anchor = W, width=10,font = ('cambria',11,),bg = 'SlateGrey') self.lbl1.grid(row = 0,column = 0,pady = 5) self.lbl2 = Label(self.right_frame, text = 'Category Type', anchor = W, width = 10,font = ('cambria',11,),bg = 'SlateGrey') self.lbl2.grid(row = 1, column = 0,pady = 5,padx=5) self.blank_label = Label(self.right_frame, bg='SlateGrey') self.blank_label.grid(row=2, columnspan=2, pady=10) # Account Type Entries self.entry1 = Entry(self.right_frame,textvariable = self.category_id, font = ('cambria',11,),bg = 'Grey',width=14) self.entry1.grid(row = 0,column=1,sticky = W,padx = 5) self.entry2 = Entry(self.right_frame, textvariable = self.category_type, font = ('cambria', 11,), bg = 'Grey',width = 14) self.entry2.grid(row = 1, column = 1, sticky = W,pady = 5,padx = 5) # Buttons self.btn_1 = Button(self.right_frame,text = 'Add',font = ('cambria',12,'bold'),bg = 'SlateGrey', activebackground='green', fg = 'white',width=12,height = 2,relief=RIDGE, command = lambda :[add_main_accounts()]) self.btn_1.grid(row = 3,column = 0,pady = 15) self.btn_2 = Button(self.right_frame, text = 'View', font = ('cambria', 12, 'bold'), bg = 'SlateGrey',command=lambda :[display_account_types()], activebackground='green', fg ='white', width=12, height = 2, relief = RIDGE) self.btn_2.grid(row = 3, column = 1) # calling the class app = Frontend(root) root.mainloop()
I got and answer to this question, I just passed in the 'self' argument to the inner nested functions of the class as below and it worked. # functions def add_main_accounts(self): if self.category_id.get() == "" or self.category_type.get() == "": tkinter.messagebox.showinfo('All fields are required') else: Backend.insert_account_type(self, self.category_id.get(), self.category_type.get()) # category type unfilled tkinter.messagebox.showinfo('Entry successful') def display_account_types(self): self.trv.delete(*self.trv.get_children()) for rows in Backend.view_account_type(self): self.trv.insert("", END, values = rows) return def get_account_type(e): self.selected_row = self.trv.focus() self.data = self.trv.item(self.selected_row) global row self.row = self.data["values"] """Grab items and send them to entry fields""" self.category_id.set(row[1]) self.category_type.set(row[2])
I think you should remove the self in display_account_types function like you did to the previous one.
Extracting HSV values from RGB Error--R
I am trying to extract HSV values from my previously collect RGB values, but I am running into an error that I don't understand. Using the code > Hmean<-rgb2hsv(Hmean, maxColorValue=255) I get the error: Error in if (any(0 > rgb) || any(rgb > 1)) stop("rgb values must be in [0, maxColorValue]") : missing value where TRUE/FALSE needed Any help would be greatly appreciated! I am new to R and am really not sure where to go from here. EDIT I have added my data below: Hmean <- structure(list(`BIOUG06754-A02` = c(60.517, 68.521, 107.304), `BIOUG06754-A04` = c(150.321, 142.084, 136.413), `BIOUG06754-A05` = c(147.89, 133.011, 92.305), `BIOUG06754-A06` = c(122.536, 131.516, 153.172), `BIOUG06754-A07` = c(123.994, 122.671, 129.04), `BIOUG06754-A11` = c(103.295, 96.326, 97.662), `BIOUG06754-A12` = c(143.705, 125.768, 99.034), `BIOUG06754-B01` = c(80.218, 84.49, 105.947 ), `BIOUG06754-B03` = c(150.792, 153.816, 177.636), `BIOUG06754-B04` = c(171.702, 150.65, 143.737), `BIOUG06754-B05` = c(180.981, 161.6, 129.986 ), `BIOUG06754-B06` = c(138.058, 130, 130.393), `BIOUG06754-B07` = c(179.172, 170.086, 148.312), `BIOUG06754-B08` = c(124.126, 121.128, 110.269), `BIOUG06754-B10` = c(162.904, 140.356, 84.089), `BIOUG06754-B11` = c(149.631, 137.925, 122.061), `BIOUG06754-B12` = c(129.984, 125.308, 126.05), `BIOUG06754-C01` = c(146.569, 148.399, 191.916), `BIOUG06754-C02` = c(81.706, 72.88, 90.784), `BIOUG06754-C05` = c(107.256, 80.714, 111.902), `BIOUG06754-C07` = c(56.156, 61.983, 102.082 ), `BIOUG06754-C09` = c(176.229, 144.778, 98.893), `BIOUG06754-C11` = c(141.205, 144.914, 123.44), `BIOUG06754-C12` = c(140.845, 137.706, 123.588), `BIOUG06754-D01` = c(134.978, 137.257, 143.5), `BIOUG06754-D03` = c(99.99, 99.829, 94.698), `BIOUG06754-D06` = c(92.634, 70.545, 45.073), `BIOUG06754-D09` = c(172.178, 160.303, 126.69 ), `BIOUG06754-D10` = c(166.664, 151.808, 128.265), `BIOUG06754-D11` = c(160.247, 122.13, 77.719), `BIOUG06754-D12` = c(153.807, 152.699, 170.198 ), `BIOUG06754-E01` = c(135.272, 133.118, 155.628), `BIOUG06754-E05` = c(124.053, 114.822, 85.961), `BIOUG06754-E07` = c(157.281, 121.47, 53.801 ), `BIOUG06754-E08` = c(77.183, 76.687, 75.278), `BIOUG06754-E09` = c(112.063, 109.666, 107.04), `BIOUG06754-E11` = c(93.102, 87.039, 79.305 ), `BIOUG06754-F01` = c(165.828, 147.252, 119.478), `BIOUG06754-F02` = c(197.223, 185.272, 159.957), `BIOUG06754-F04` = c(152.897, 136.457, 141.096), `BIOUG06754-F05` = c(117.035, 119.651, 145.869), `BIOUG06754-F06` = c(185.506, 173.124, 157.736), `BIOUG06754-F12` = c(148.994, 140.52, 165.125), `BIOUG06754-G01` = c(128.958, 122.56, 113.381 ), `BIOUG06754-G02` = c(144.513, 136.457, 128.134), `BIOUG06754-G08` = c(113.76, 106.878, 98.195), `BIOUG06754-G09` = c(95.095, 87.19, 104.044 ), `BIOUG06754-G10` = c(106.903, 112.908, 132.635), `BIOUG06754-G12` = c(153.118, 131.854, 129.546), `BIOUG06754-H01` = c(166.928, 171.271, 174.863), `BIOUG06754-H02` = c(192.864, 166.996, 103.896), `BIOUG06754-H03` = c(119.428, 116.207, 107.578), `BIOUG06754-H06` = c(156.38, 157.738, 166.2), `BIOUG06754-H07` = c(200.05, 193.561, 180.402 ), `BIOUG06754-H08` = c(138.912, 141.456, 139.468), `BIOUG07431-A01` = c(196.442, 194.256, 198.569), `BIOUG07431-A02` = c(199.362, 203.439, 221.293), `BIOUG07431-A04` = c(110.508, 109.606, 125.026), `BIOUG07431-A05` = c(154.941, 142.16, 162.201), `BIOUG07431-A07` = c(133.31, 124.794, 166.369), `BIOUG07431-A08` = c(152.72, 145.893, 161.726), `BIOUG07431-A11` = c(193.428, 195.137, 202.514), `BIOUG07431-B01` = c(173.636, 158.312, 166.014), `BIOUG07431-B03` = c(113.928, 101.418, 119.616), `BIOUG07431-B04` = c(158.961, 149.822, 135.504), `BIOUG07431-B05` = c(181.021, 160.866, 135.597), `BIOUG07431-B06` = c(166.364, 166.912, 165.706), `BIOUG07431-B08` = c(108.665, 100.64, 109.878), `BIOUG07431-B09` = c(112.773, 116.487, 136.531), `BIOUG07431-B10` = c(108.834, 103.844, 115.001), `BIOUG07431-B11` = c(86.766, 97.206, 144.516), `BIOUG07431-C02` = c(98.251, 88.443, 127.958), `BIOUG07431-C05` = c(113.635, 117.251, 133.339), `BIOUG07431-C06` = c(115.451, 119.857, 149.481), `BIOUG07431-C08` = c(159.056, 128.007, 110.938), `BIOUG07431-C12` = c(126.557, 125.67, 126.041), `BIOUG07431-D01` = c(214.479, 191.064, 143.42), `BIOUG07431-D02` = c(180.004, 173.532, 161.336), `BIOUG07431-D03` = c(201.794, 192.762, 179.586), `BIOUG07431-D04` = c(125.512, 132.976, 163.184), `BIOUG07431-D05` = c(142.465, 124.835, 113.436), `BIOUG07431-D06` = c(185.26, 186.626, 208.822), `BIOUG07431-D07` = c(195.833, 198.765, 205.444), `BIOUG07431-D09` = c(124.785, 124.127, 144.171), `BIOUG07431-D12` = c(129.071, 140.159, 171.218), `BIOUG07431-E02` = c(182.027, 182.472, 180.621), `BIOUG07431-E03` = c(126.32, 126.024, 133.868), `BIOUG07431-E04` = c(89.118, 72.014, 46.126), `BIOUG07431-E05` = c(125.737, 117.231, 154.487 ), `BIOUG07431-E06` = c(161.714, 152.781, 130.912), `BIOUG07431-E07` = c(149.006, 144.284, 132.184), `BIOUG07431-E09` = c(118.235, 116.151, 123.239), `BIOUG07431-E12` = c(161.982, 163.57, 195.893), `BIOUG07431-F01` = c(210.534, 183.649, 136.178), `BIOUG07431-F06` = c(143.074, 129.267, 105.536), `BIOUG07431-G03` = c(194.663, 168.915, 137.132), `BIOUG07431-G06` = c(125.605, 92.018, 61.595), `BIOUG07431-G07` = c(162.248, 143.445, 169.436), `BIOUG07431-G09` = c(197.991, 197.706, 197.506), `BIOUG07431-G10` = c(156.518, 145.15, 156.341), `BIOUG07431-G11` = c(154.482, 141.215, 144.517), `BIOUG07431-H01` = c(120.332, 122.402, 140.211), `BIOUG07431-H02` = c(153.665, 148.427, 159.549), `BIOUG07431-H04` = c(239.422, 214.916, 171.416), `BIOUG07431-H06` = c(194.847, 181.091, 139.541), `BIOUG07431-H07` = c(200.076, 193.944, 181.532), `BIOUG07797-A01` = c(148.506, 146.768, 173.34), `BIOUG07797-A02` = c(147.511, 144.895, 189.464), `BIOUG07797-A03` = c(222.678, 225.497, 230.171), `BIOUG07797-A05` = c(119.967, 131.053, 203.64), `BIOUG07797-A08` = c(104.015, 108.071, 124.549), `BIOUG07797-A09` = c(164.519, 159.228, 140.04), `BIOUG07797-A11` = c(189.19, 182.955, 189.946), `BIOUG07797-B01` = c(106.99, 110.57, 141.549), `BIOUG07797-B02` = c(113.587, 110.997, 149.402), `BIOUG07797-C01` = c(117.026, 114.161, 128.523), `BIOUG07797-C04` = c(83.18, 84.456, 111.268), `BIOUG07797-C05` = c(118.447, 119.369, 156.932), `BIOUG07797-C06` = c(176.7, 165.73, 139.284 ), `BIOUG07797-C11` = c(148.172, 127.719, 122.872), `BIOUG07797-D02` = c(106.939, 95.452, 108.28), `BIOUG07797-D10` = c(143.813, 130.423, 111.83 ), `BIOUG07797-F03` = c(78.894, 54.359, 50.642), `BIOUG07797-F04` = c(145.08, 123.273, 117.647), `BIOUG07797-F06` = c(235.565, 180.099, 56.442), `BIOUG07797-F07` = c(180.997, 183.258, 183.278), `BIOUG07797-G11` = c(170.54, 175.451, 170.098), `BIOUG07797-H01` = c(190.966, 188.429, 166.054), `BIOUG07797-H09` = c(90.894, 85.603, 111.644 ), `BIOUG09330-A02` = c(78.074, 91.958, 152.859), `BIOUG09330-A03` = c(117.371, 130.345, 172.74), `BIOUG09330-A04` = c(91.953, 110.488, 159.267 ), `BIOUG09330-A05` = c(108.764, 95.986, 109.759), `BIOUG09330-A06` = c(150.302, 107.83, 73.904), `BIOUG09330-A07` = c(97.401, 120.961, 211.18 ), `BIOUG09330-A09` = c(74.834, 79.806, 120.349), `BIOUG09330-A10` = c(95.294, 96.306, 144.771), `BIOUG09330-A11` = c(64.172, 45.898, 71.995 ), `BIOUG09330-A12` = c(117.116, 126.698, 168.934), `BIOUG09330-B01` = c(52.654, 64.766, 128.408), `BIOUG09330-B02` = c(107.182, 133.682, 188.383), `BIOUG09330-B04` = c(125.463, 91.091, 43.414), `BIOUG09330-B05` = c(NA_real_, NA_real_, NA_real_), `BIOUG09330-B06` = c(56.263, 54.981, 81.805), `BIOUG09330-B07` = c(162.31, 159.495, 166.396 ), `BIOUG09330-B08` = c(125.672, 122.209, 116.596), `BIOUG09330-B09` = c(135.056, 129.756, 162.686), `BIOUG09330-B10` = c(202.435, 208.733, 241.3), `BIOUG09330-B11` = c(169.697, 156.222, 141.06), `BIOUG09330-B12` = c(128.235, 102.118, 106.082), `BIOUG09330-C01` = c(98.755, 122.772, 209.765), `BIOUG09330-C02` = c(NA_real_, NA_real_, NA_real_ ), `BIOUG09330-C05` = c(158.578, 130.13, 69.21), `BIOUG09330-C08` = c(103.718, 117.53, 147.786), `BIOUG09330-D02` = c(117.738, 114.214, 118.959), `BIOUG09330-D04` = c(130.504, 122.31, 138.672), `BIOUG09330-D06` = c(218.095, 195.467, 144.224), `BIOUG09330-D07` = c(157.568, 145.151, 91.566), `BIOUG09330-D08` = c(175.808, 172.062, 161.954), `BIOUG09330-D09` = c(144.897, 157.836, 189.74), `BIOUG09330-D11` = c(76.909, 88.817, 121.806), `BIOUG09330-D12` = c(124.881, 126.963, 171.977), `BIOUG09330-E05` = c(129.372, 127.583, 187.464), `BIOUG09330-E08` = c(88.864, 103.971, 212.299), `BIOUG09330-E09` = c(64.557, 72.148, 138.387), `BIOUG09330-E11` = c(135.383, 141.872, 165.028), `BIOUG09330-E12` = c(157.918, 167.997, 181.808), `BIOUG09330-F04` = c(70.144, 79.535, 180.141), `BIOUG09330-F05` = c(70.921, 70.844, 104.806), `BIOUG09330-F09` = c(124.519, 129.736, 189.402), `BIOUG09330-F10` = c(210.979, 205.764, 212.236), `BIOUG09330-F11` = c(190.944, 183.007, 157.038), `BIOUG09330-F12` = c(211.616, 155.883, 39.493), `BIOUG09330-G01` = c(108.666, 120.852, 159.902), `BIOUG09330-G02` = c(156.677, 146.856, 135.241), `BIOUG09330-G03` = c(130.527, 137.194, 144.195), `BIOUG09330-G04` = c(84.576, 81.307, 105.66), `BIOUG09330-G05` = c(144.604, 147.933, 177.82), `BIOUG09330-G06` = c(158.099, 155.194, 175.577), `BIOUG09330-G07` = c(74.709, 67.784, 102.697), `BIOUG09330-G08` = c(76.496, 74.44, 107.494), `BIOUG09330-G09` = c(183.169, 192.008, 235.085), `BIOUG09330-G10` = c(184.362, 180.48, 159.234), `BIOUG09330-G12` = c(77.055, 86.239, 143.91), `BIOUG09330-H06` = c(74.967, 79.455, 144.986), `BIOUG09330-H07` = c(70.484, 70.173, 105.897 ), `BIOUG09330-H09` = c(174.575, 150.184, 80.233), `BIOUG09331-A03` = c(129.706, 113.527, 74.197), `BIOUG09331-A04` = c(136.851, 129.773, 117.237), `BIOUG09331-A05` = c(157.295, 147.808, 124.672), `BIOUG09331-A06` = c(92.13, 90.853, 93.149), `BIOUG09331-A07` = c(144.478, 120.684, 78.015), `BIOUG09331-A08` = c(136.908, 122.667, 88.92), `BIOUG09331-A09` = c(135.86, 106.256, 55.891), `BIOUG09331-A10` = c(203.39, 157.816, 91.879), `BIOUG09331-A11` = c(138.371, 123.186, 96.59), `BIOUG09331-A12` = c(95.404, 88.144, 78.755), `BIOUG09331-B01` = c(91.657, 76.132, 73.637), `BIOUG09331-B03` = c(114.362, 97.15, 87.333 ), `BIOUG09331-B04` = c(125.27, 114.192, 111.006), `BIOUG09331-B05` = c(238.213, 199.398, 99.51), `BIOUG09331-B06` = c(162.797, 133.397, 96.207 ), `BIOUG09331-B07` = c(170.996, 152.071, 91.138), `BIOUG09331-B08` = c(90.596, 83.036, 85.444), `BIOUG09331-B09` = c(78.688, 71.075, 89.184 ), `BIOUG09331-B10` = c(125.612, 113.445, 109.073), `BIOUG09331-B11` = c(145.36, 129.069, 106.892), `BIOUG09331-B12` = c(106.722, 100.317, 89.757), `BIOUG09331-C01` = c(218.155, 179.369, 88.206), `BIOUG09331-C03` = c(90.819, 93.85, 127.7), `BIOUG09331-C04` = c(141.697, 133.081, 128.473), `BIOUG09331-C08` = c(80.76, 78.165, 84.414 ), `BIOUG09331-C09` = c(99.405, 91.629, 88.325), `BIOUG09331-C10` = c(160.779, 152.102, 128.027), `BIOUG09331-C11` = c(146.007, 121.818, 123.986), `BIOUG09331-C12` = c(155.322, 126.561, 76.122), `BIOUG09331-D01` = c(114.51, 108.85, 106.159), `BIOUG09331-D02` = c(168.561, 158.569, 142.675), `BIOUG09331-D03` = c(93.604, 77.639, 72.308 ), `BIOUG09331-D04` = c(115.836, 106.453, 97.403), `BIOUG09331-D05` = c(201.406, 168.583, 121.714), `BIOUG09331-D06` = c(64.72, 39.534, 61.58 ), `BIOUG09331-D07` = c(104.396, 90.888, 88.357), `BIOUG09331-D08` = c(190.058, 162.695, 122.753), `BIOUG09331-D09` = c(130.358, 119.073, 113.842), `BIOUG09331-D10` = c(208.173, 184.573, 150.762), `BIOUG09331-D11` = c(75.621, 68.526, 100.973), `BIOUG09331-D12` = c(120.384, 113.948, 126.971), `BIOUG09331-E02` = c(131.588, 105.849, 112.459), `BIOUG09331-E05` = c(165.058, 153.182, 136.807), `BIOUG09331-E08` = c(205.842, 149.21, 46.914), `BIOUG09331-E09` = c(119.88, 96.932, 81.06), `BIOUG09331-E10` = c(142.077, 129.643, 113.374 ), `BIOUG09331-E11` = c(174.945, 158.418, 140.231), `BIOUG09331-E12` = c(190.955, 157.802, 101.379), `BIOUG09331-F02` = c(149.787, 134.032, 118.371), `BIOUG09331-F03` = c(165.562, 153.43, 129.294), `BIOUG09331-F04` = c(137.762, 130.078, 114.159), `BIOUG09331-F05` = c(154.205, 137.268, 113.15), `BIOUG09331-F06` = c(139.79, 114.26, 79.178 ), `BIOUG09331-F07` = c(164.205, 143.319, 124.28), `BIOUG09331-F08` = c(103.566, 91.445, 117.365), `BIOUG09331-F09` = c(129.748, 116.184, 112.51), `BIOUG09331-F10` = c(89.52, 82.218, 92.811), `BIOUG09331-G03` = c(193.037, 167.988, 161.19), `BIOUG09331-G04` = c(66.484, 61.662, 107.38 ), `BIOUG09331-G05` = c(78.386, 79.355, 127.106), `BIOUG09331-G06` = c(130.345, 121.306, 157.942), `BIOUG09331-G10` = c(228.768, 220.396, 213.442), `BIOUG09331-G11` = c(74.002, 66.019, 115.924), `BIOUG09331-H02` = c(205.078, 182.418, 134.441), `BIOUG09331-H06` = c(175.326, 173.91, 203.724), `BIOUG09331-H08` = c(173.58, 158.376, 136.998 ), `BIOUG09331-H09` = c(81.942, 83.35, 141.956), `BIOUG09331-H10` = c(54.907, 59.226, 100.034), `BIOUG09331-H11` = c(104.378, 99.155, 120 ), `BIOUG09332-A01` = c(144.726, 137.16, 172.673), `BIOUG09332-A03` = c(165.363, 159.332, 152.342), `BIOUG09332-A05` = c(199.72, 201.405, 204.246), `BIOUG09332-A06` = c(161.826, 164.125, 180.692), `BIOUG09332-A07` = c(136.393, 145.575, 171.102), `BIOUG09332-A08` = c(128.538, 131.427, 152.795), `BIOUG09332-A10` = c(184.266, 174.629, 162.196), `BIOUG09332-B03` = c(208.574, 207.05, 205.724), `BIOUG09332-B05` = c(101.794, 110.731, 155.385), `BIOUG09332-B07` = c(122.239, 112.155, 127.472), `BIOUG09332-B09` = c(187.713, 182.566, 170.627), `BIOUG09332-B11` = c(133.217, 133.466, 129.422), `BIOUG09332-C01` = c(101.814, 91.709, 107.163), `BIOUG09332-C03` = c(91.116, 96.167, 131.836), `BIOUG09332-C05` = c(160.936, 156.711, 152.594), `BIOUG09332-C06` = c(149.988, 137.356, 110.038), `BIOUG09332-C07` = c(126.787, 121.185, 127.856), `BIOUG09332-C09` = c(108.19, 120.506, 190.562), `BIOUG09332-C11` = c(175.914, 167.613, 170.927), `BIOUG09332-C12` = c(82.267, 78.821, 94.969), `BIOUG09332-D01` = c(68.758, 70.229, 93.4), `BIOUG09332-D09` = c(144.802, 138.01, 151.703 ), `BIOUG09332-E01` = c(88.358, 92.77, 132.612), `BIOUG09332-E05` = c(106.86, 59.931, 66.577), `BIOUG09332-E09` = c(197.423, 189.931, 176.184 ), `BIOUG09332-E10` = c(151.695, 121.97, 69.789), `BIOUG09332-E11` = c(74.158, 63.902, 68.372), `BIOUG09332-F06` = c(109.16, 120.619, 174.715 ), `BIOUG09332-F09` = c(144.682, 120.658, 129.593), `BIOUG09332-F11` = c(137.976, 113.727, 87.593), `BIOUG09332-G02` = c(182.113, 145.291, 84.664), `BIOUG09332-G03` = c(150.52, 121.721, 96.076), `BIOUG09332-G04` = c(175.154, 165.939, 163.944), `BIOUG09332-G05` = c(217.682, 203.291, 184.977), `BIOUG09332-G06` = c(154.436, 116.008, 59.53), `BIOUG09332-G08` = c(177.95, 142.221, 93.299), `BIOUG09332-G09` = c(213.532, 166.837, 79.52), `BIOUG09332-G11` = c(194.616, 164.073, 126.89 ), `BIOUG09332-H01` = c(151.457, 133.94, 142.631), `BIOUG09332-H06` = c(99.24, 68.681, 52.919), `BIOUG09332-H07` = c(218.904, 150.498, 4.059 ), `BIOUG09332-H08` = c(173.864, 142.466, 109.555), `BIOUG09332-H09` = c(195.81, 156.113, 72.609), `BIOUG09332-H10` = c(178.388, 164.201, 154.31), `BIOUG09332-H11` = c(149.498, 136.439, 122.352)), .Names = c("BIOUG06754-A02", "BIOUG06754-A04", "BIOUG06754-A05", "BIOUG06754-A06", "BIOUG06754-A07", "BIOUG06754-A11", "BIOUG06754-A12", "BIOUG06754-B01", "BIOUG06754-B03", "BIOUG06754-B04", "BIOUG06754-B05", "BIOUG06754-B06", "BIOUG06754-B07", "BIOUG06754-B08", "BIOUG06754-B10", "BIOUG06754-B11", "BIOUG06754-B12", "BIOUG06754-C01", "BIOUG06754-C02", "BIOUG06754-C05", "BIOUG06754-C07", "BIOUG06754-C09", "BIOUG06754-C11", "BIOUG06754-C12", "BIOUG06754-D01", "BIOUG06754-D03", "BIOUG06754-D06", "BIOUG06754-D09", "BIOUG06754-D10", "BIOUG06754-D11", "BIOUG06754-D12", "BIOUG06754-E01", "BIOUG06754-E05", "BIOUG06754-E07", "BIOUG06754-E08", "BIOUG06754-E09", "BIOUG06754-E11", "BIOUG06754-F01", "BIOUG06754-F02", "BIOUG06754-F04", "BIOUG06754-F05", "BIOUG06754-F06", "BIOUG06754-F12", "BIOUG06754-G01", "BIOUG06754-G02", "BIOUG06754-G08", "BIOUG06754-G09", "BIOUG06754-G10", "BIOUG06754-G12", "BIOUG06754-H01", "BIOUG06754-H02", "BIOUG06754-H03", "BIOUG06754-H06", "BIOUG06754-H07", "BIOUG06754-H08", "BIOUG07431-A01", "BIOUG07431-A02", "BIOUG07431-A04", "BIOUG07431-A05", "BIOUG07431-A07", "BIOUG07431-A08", "BIOUG07431-A11", "BIOUG07431-B01", "BIOUG07431-B03", "BIOUG07431-B04", "BIOUG07431-B05", "BIOUG07431-B06", "BIOUG07431-B08", "BIOUG07431-B09", "BIOUG07431-B10", "BIOUG07431-B11", "BIOUG07431-C02", "BIOUG07431-C05", "BIOUG07431-C06", "BIOUG07431-C08", "BIOUG07431-C12", "BIOUG07431-D01", "BIOUG07431-D02", "BIOUG07431-D03", "BIOUG07431-D04", "BIOUG07431-D05", "BIOUG07431-D06", "BIOUG07431-D07", "BIOUG07431-D09", "BIOUG07431-D12", "BIOUG07431-E02", "BIOUG07431-E03", "BIOUG07431-E04", "BIOUG07431-E05", "BIOUG07431-E06", "BIOUG07431-E07", "BIOUG07431-E09", "BIOUG07431-E12", "BIOUG07431-F01", "BIOUG07431-F06", "BIOUG07431-G03", "BIOUG07431-G06", "BIOUG07431-G07", "BIOUG07431-G09", "BIOUG07431-G10", "BIOUG07431-G11", "BIOUG07431-H01", "BIOUG07431-H02", "BIOUG07431-H04", "BIOUG07431-H06", "BIOUG07431-H07", "BIOUG07797-A01", "BIOUG07797-A02", "BIOUG07797-A03", "BIOUG07797-A05", "BIOUG07797-A08", "BIOUG07797-A09", "BIOUG07797-A11", "BIOUG07797-B01", "BIOUG07797-B02", "BIOUG07797-C01", "BIOUG07797-C04", "BIOUG07797-C05", "BIOUG07797-C06", "BIOUG07797-C11", "BIOUG07797-D02", "BIOUG07797-D10", "BIOUG07797-F03", "BIOUG07797-F04", "BIOUG07797-F06", "BIOUG07797-F07", "BIOUG07797-G11", "BIOUG07797-H01", "BIOUG07797-H09", "BIOUG09330-A02", "BIOUG09330-A03", "BIOUG09330-A04", "BIOUG09330-A05", "BIOUG09330-A06", "BIOUG09330-A07", "BIOUG09330-A09", "BIOUG09330-A10", "BIOUG09330-A11", "BIOUG09330-A12", "BIOUG09330-B01", "BIOUG09330-B02", "BIOUG09330-B04", "BIOUG09330-B05", "BIOUG09330-B06", "BIOUG09330-B07", "BIOUG09330-B08", "BIOUG09330-B09", "BIOUG09330-B10", "BIOUG09330-B11", "BIOUG09330-B12", "BIOUG09330-C01", "BIOUG09330-C02", "BIOUG09330-C05", "BIOUG09330-C08", "BIOUG09330-D02", "BIOUG09330-D04", "BIOUG09330-D06", "BIOUG09330-D07", "BIOUG09330-D08", "BIOUG09330-D09", "BIOUG09330-D11", "BIOUG09330-D12", "BIOUG09330-E05", "BIOUG09330-E08", "BIOUG09330-E09", "BIOUG09330-E11", "BIOUG09330-E12", "BIOUG09330-F04", "BIOUG09330-F05", "BIOUG09330-F09", "BIOUG09330-F10", "BIOUG09330-F11", "BIOUG09330-F12", "BIOUG09330-G01", "BIOUG09330-G02", "BIOUG09330-G03", "BIOUG09330-G04", "BIOUG09330-G05", "BIOUG09330-G06", "BIOUG09330-G07", "BIOUG09330-G08", "BIOUG09330-G09", "BIOUG09330-G10", "BIOUG09330-G12", "BIOUG09330-H06", "BIOUG09330-H07", "BIOUG09330-H09", "BIOUG09331-A03", "BIOUG09331-A04", "BIOUG09331-A05", "BIOUG09331-A06", "BIOUG09331-A07", "BIOUG09331-A08", "BIOUG09331-A09", "BIOUG09331-A10", "BIOUG09331-A11", "BIOUG09331-A12", "BIOUG09331-B01", "BIOUG09331-B03", "BIOUG09331-B04", "BIOUG09331-B05", "BIOUG09331-B06", "BIOUG09331-B07", "BIOUG09331-B08", "BIOUG09331-B09", "BIOUG09331-B10", "BIOUG09331-B11", "BIOUG09331-B12", "BIOUG09331-C01", "BIOUG09331-C03", "BIOUG09331-C04", "BIOUG09331-C08", "BIOUG09331-C09", "BIOUG09331-C10", "BIOUG09331-C11", "BIOUG09331-C12", "BIOUG09331-D01", "BIOUG09331-D02", "BIOUG09331-D03", "BIOUG09331-D04", "BIOUG09331-D05", "BIOUG09331-D06", "BIOUG09331-D07", "BIOUG09331-D08", "BIOUG09331-D09", "BIOUG09331-D10", "BIOUG09331-D11", "BIOUG09331-D12", "BIOUG09331-E02", "BIOUG09331-E05", "BIOUG09331-E08", "BIOUG09331-E09", "BIOUG09331-E10", "BIOUG09331-E11", "BIOUG09331-E12", "BIOUG09331-F02", "BIOUG09331-F03", "BIOUG09331-F04", "BIOUG09331-F05", "BIOUG09331-F06", "BIOUG09331-F07", "BIOUG09331-F08", "BIOUG09331-F09", "BIOUG09331-F10", "BIOUG09331-G03", "BIOUG09331-G04", "BIOUG09331-G05", "BIOUG09331-G06", "BIOUG09331-G10", "BIOUG09331-G11", "BIOUG09331-H02", "BIOUG09331-H06", "BIOUG09331-H08", "BIOUG09331-H09", "BIOUG09331-H10", "BIOUG09331-H11", "BIOUG09332-A01", "BIOUG09332-A03", "BIOUG09332-A05", "BIOUG09332-A06", "BIOUG09332-A07", "BIOUG09332-A08", "BIOUG09332-A10", "BIOUG09332-B03", "BIOUG09332-B05", "BIOUG09332-B07", "BIOUG09332-B09", "BIOUG09332-B11", "BIOUG09332-C01", "BIOUG09332-C03", "BIOUG09332-C05", "BIOUG09332-C06", "BIOUG09332-C07", "BIOUG09332-C09", "BIOUG09332-C11", "BIOUG09332-C12", "BIOUG09332-D01", "BIOUG09332-D09", "BIOUG09332-E01", "BIOUG09332-E05", "BIOUG09332-E09", "BIOUG09332-E10", "BIOUG09332-E11", "BIOUG09332-F06", "BIOUG09332-F09", "BIOUG09332-F11", "BIOUG09332-G02", "BIOUG09332-G03", "BIOUG09332-G04", "BIOUG09332-G05", "BIOUG09332-G06", "BIOUG09332-G08", "BIOUG09332-G09", "BIOUG09332-G11", "BIOUG09332-H01", "BIOUG09332-H06", "BIOUG09332-H07", "BIOUG09332-H08", "BIOUG09332-H09", "BIOUG09332-H10", "BIOUG09332-H11" ), row.names = c("Red", "Green", "Blue"), class = "data.frame")
These data would be much easier to work with if each sample was a row, and the colors were on the columns: Hmean.transpose <- as.data.frame(t(Hmean)) head(Hmean.transpose) Red Green Blue BIOUG06754-A02 60.517 68.521 107.304 BIOUG06754-A04 150.321 142.084 136.413 BIOUG06754-A05 147.890 133.011 92.305 BIOUG06754-A06 122.536 131.516 153.172 BIOUG06754-A07 123.994 122.671 129.040 BIOUG06754-A11 103.295 96.326 97.662 ... Now it's easier to see which rows have NA values: subset(Hmean.transpose, is.na(Red)) Red Green Blue BIOUG09330-B05 NA NA NA BIOUG09330-C02 NA NA NA If we filter these out, the color conversion will work as expected: Hmean.filter <- subset(Hmean.transpose, !is.na(Red)) data.hsv <- with(Hmean.filter, rgb2hsv(Red, Green, Blue))
If you just want to drop NA values, you can exclude columns that have NA values. For example sapply(Filter(function(x) any(!is.na(x)), Hmean), rgb2hsv, maxColorValue=255) Or using the tidyverse purrr functions, library(purrr) Hmean %>% discard(~any(is.na(.))) %>% map_dfr(rgb2hsv, maxColorValue=255)
Xamarin.Forms: Putting A Label Inside A BarChart Layout
I am using oxyplot to plot a bar chart. I wish to add an extra label in the chart. I've tried to use Textannotation but it's not showing on the chart. What is the mistake I'm making to cause the text not to appear, is it the DataPoint? Please help. plotModel = new PlotModel { Title = "Daily", LegendPlacement = LegendPlacement.Outside, LegendPosition = LegendPosition.BottomCenter, LegendOrientation = LegendOrientation.Horizontal, LegendBorderThickness = 0 }; TextAnnotation txtlabel = new TextAnnotation(); txtlabel.Text = "Test"; txtlabel.TextColor = OxyColors.Red; txtlabel.Stroke = OxyColors.Red; txtlabel.StrokeThickness = 5; txtlabel.FontSize = 36; txtlabel.TextPosition = new DataPoint(21, 3.5); plotModel.Annotations.Add(txtlabel); string sPrevType = ""; string sCurrentType = ""; DateTime dtdate; var sr = new ColumnSeries(); var col = new ColumnItem(); int iCount = 0; List<decimal> lstI = new List<decimal>(); List<decimal> lstD = new List<decimal>(); List<decimal> lstS = new List<decimal>(); foreach (var itm in _dateodr) { dtdate = itm.date; sCurrentType = itm.Type; lstI.Add(itm.I_Unit); lstD.Add(itm.D_Unit); lstS.Add(itm.S_Unit); if (sCurrentType != sPrevType && sPrevType != "") { sr = new ColumnSeries(); sr.Title = sPrevType; sr.LabelPlacement = LabelPlacement.Outside; sr.StrokeColor = OxyColors.Black; sr.StrokeThickness = 1; //sr.LabelFormatString = "{0:#,##0.00}"; plotModel.Series.Add(sr); } sPrevType = sCurrentType; iCount += 1; } if (iCount == _dateodr.Count) { sr = new ColumnSeries(); sr.Title = sPrevType; sr.LabelPlacement = LabelPlacement.Outside; sr.StrokeColor = OxyColors.Black; sr.StrokeThickness = 1; //sr.LabelFormatString = "{0:#,##0.00}"; sr.FontSize = 10; plotModel.Series.Add(sr); } for (int i = 0; i < iCount; i++) { ColumnSeries ssr = (ColumnSeries)plotModel.Series[i]; var colIm = new ColumnItem(); colIitm.Value = double.Parse(lstI[i].ToString()) / 1000; ssr.Items.Add(colIitm); var colDOitm = new ColumnItem(); colDitm.Value = double.Parse(lstD[i].ToString()) / 1000; ssr.Items.Add(colDitm); var colSitm = new ColumnItem(); colSitm.Value = double.Parse(lstS[i].ToString()) / 1000; ssr.Items.Add(colSitm); } categoryaxis.Labels.Add("I"); categoryaxis.Labels.Add("Dr"); categoryaxis.Labels.Add("Sr"); switch (sUnitType) { case "2": valueAxis = new LinearAxis { Position = AxisPosition.Left, MinimumPadding = 0, MaximumPadding = 0.06, AbsoluteMinimum = 0, Title = "m", Angle = 90, FontWeight = FontWeights.Bold, FontSize = 15 }; break; case "qy": valueAxis = new LinearAxis { Position = AxisPosition.Left, MinimumPadding = 0, MaximumPadding = 0.06, AbsoluteMinimum = 0, Title = "Qy", Angle = 90, FontWeight = FontWeights.Bold, FontSize = 15 }; break; case "Am": valueAxis = new LinearAxis { Position = AxisPosition.Left, MinimumPadding = 0, MaximumPadding = 0.06, AbsoluteMinimum = 0, Title = "Am", Angle = 90, FontWeight = FontWeights.Bold, FontSize = 15 }; break; } plotModel.Axes.Add(categoryaxis); plotModel.Axes.Add(valueAxis); } PlotView plot = new PlotView { VerticalOptions = LayoutOptions.Fill, HorizontalOptions = LayoutOptions.Fill, BackgroundColor = Color.White, Model = plotModel }; Content = plot;
Putting labels inside of a vb.net Array
So i've created 5 different arrays for labels These are Dim ovsoLabels As Label(), customerLabels() As Label, itemNameLabels() As Label, quantityLabels() As Label, topRightItemNameLbls(5) As Label Dim indexLabels() As Label After that I have a function that assigns those variables to actual labels. 'assign labels to array ovsoLabels(0) = oVSO10 ovsoLabels(1) = oVSO11 ovsoLabels(2) = oVSO12 ovsoLabels(3) = oVSO13 ovsoLabels(4) = oVSO14 customerLabels(0) = custLbl20 customerLabels(1) = custLbl21 customerLabels(2) = custLbl22 customerLabels(3) = custLbl23 customerLabels(4) = custLbl24 itemNameLabels(0) = nameLbl1 itemNameLabels(1) = nameLbl2 itemNameLabels(2) = nameLbl3 itemNameLabels(3) = nameLbl4 itemNameLabels(4) = nameLbl5 quantityLabels(0) = quantLbl1 quantityLabels(1) = quantLbl2 quantityLabels(2) = quantLbl3 quantityLabels(3) = quantLbl4 quantityLabels(4) = quantLbl6 indexLabels(0) = indexLbl10 indexLabels(1) = indexLbl11 indexLabels(2) = indexLbl12 indexLabels(3) = indexLbl13 indexLabels(4) = indexLbl14 After that I call the function in my timer tick and this is what i'm triying to do (Not quoteArray has numbers in it 0 - infinity) For i = 0 To 4 If quantityArray(i) = Nothing Then ElseIf quantityArray(i) = 0 Then quantityLabels(i).ForeColor = Drawing.Color.Green customerLabels(i).ForeColor = Drawing.Color.Green itemNameLabels(i).ForeColor = Drawing.Color.Green ovsoLabels(i).ForeColor = Drawing.Color.Green indexLabels(i).ForeColor = Drawing.Color.Green Else quantityLabels(i).ForeColor = Drawing.Color.Black customerLabels(i).ForeColor = Drawing.Color.Black itemNameLabels(i).ForeColor = Drawing.Color.Black ovsoLabels(i).ForeColor = Drawing.Color.Black indexLabels(i).ForeColor = Drawing.Color.Black End If Next This is my first post, so tell me if I can format better. The error I'm getting is that it tells me that there is no object and I need to use the keyword new. Not sure what that means, thanks!
Dynamic Linq Select from String Value
Question Edit because simple table doesnt make things simpler.. The issue is i have to pick dynamic column value.. the column name came from prev page (DropDownList) => Current Page (HiddenField) This is my Current Codes: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Drawing; using System.Data; public partial class ViewChart : System.Web.UI.Page { BlupDataContext database = new BlupDataContext(); protected void Page_Load(object sender, EventArgs e) { HiddenFieldWCellName.Value = Request.QueryString["WCEL_Name"]; HiddenFieldSeries1.Value = Request.QueryString["Series1"]; HiddenFieldSeries2.Value = Request.QueryString["Series2"]; var q = from x in database.RSRAN079s join y in database.RSRAN084s on x.WCEL_Name equals y.WCEL_Name where x.WCEL_Name == HiddenFieldWCellName.Value select new { RSRAN079_ID = x.RSRAN079_ID, PeriodStartTime = x.PeriodStartTime, PLMN_Name = x.PLMN_Name, RNC_Name = x.RNC_Name, WBTS_Name = x.WBTS_Name, WBTS_ID = x.WBTS_ID, WCEL_Name = x.WCEL_Name, WCEL_ID = x.WCEL_ID, RRC_Conn_Access_Completitions = x.RRC_Conn_Access_Completitions, RRC_Active_Drops_IU_FR = x.RRC_Active_Drops_IU_FR, RRC_Active_Drops_IU_Fails = x.RRC_Active_Drops_IU_Fails, RRC_Active_Drops_Radio_FR = x.RRC_Active_Drops_Radio_FR, RRC_Active_Drops_Radio_Fails = x.RRC_Active_Drops_Radio_Fails, RRC_Active_Drops_BTS_FR = x.RRC_Active_Drops_BTS_FR, RRC_Active_Drops_BTS_Fails = x.RRC_Active_Drops_BTS_Fails, RRC_Active_Drops_IUR_FR = x.RRC_Active_Drops_IUR_FR, RRC_Active_Drops_IUR_Fails = x.RRC_Active_Drops_IUR_Fails, RRC_Active_Drops_CIPH_FR = x.RRC_Active_Drops_CIPH_FR, RRC_Active_Drops_CIPH_Fails = x.RRC_Active_Drops_CIPH_Fails, RRC_Active_Drops_RNC_FR = x.RRC_Active_Drops_RNC_FR, RRC_Active_Drops_RNC_Fails = x.RRC_Active_Drops_RNC_Fails, RRC_Active_Drops_UE_FR = x.RRC_Active_Drops_UE_FR, RRC_Active_Drops_UE_Fails = x.RRC_Active_Drops_UE_Fails, RAB_Retainability_CS_Voice_SR = x.RAB_Retainability_CS_Voice_SR, RAB_Retainability_CS_Conv_SR = x.RAB_Retainability_CS_Conv_SR, RAB_Retainability_PS_SR = x.RAB_Retainability_PS_SR, AMR_RAB_Setup_Access_Completitions = x.AMR_RAB_Setup_Access_Completitions, AMR_RAB_Drop_Active_Drops_IF_FR = x.AMR_RAB_Drop_Active_Drops_IF_FR, AMR_RAB_Drop_Active_Drops_IU_Fails = x.AMR_RAB_Drop_Active_Drops_IU_Fails, AMR_RAB_Drop_Active_Drops_Radio_FR = x.AMR_RAB_Drop_Active_Drops_Radio_FR, AMR_RAB_Drop_Active_Drops_Radio_Fails = x.AMR_RAB_Drop_Active_Drops_Radio_Fails, AMR_RAB_Drop_Active_Drops_BTS_FR = x.AMR_RAB_Drop_Active_Drops_BTS_FR, AMR_RAB_Drop_Active_Drops_BTS_Fails = x.AMR_RAB_Drop_Active_Drops_BTS_Fails, AMR_RAB_Drop_Active_Drops_IUR_FR = x.AMR_RAB_Drop_Active_Drops_IUR_FR, AMR_RAB_Drop_Active_Drops_IUR_Fails = x.AMR_RAB_Drop_Active_Drops_IUR_Fails, AMR_RAB_Drop_Active_Drops_RNC_FR = x.AMR_RAB_Drop_Active_Drops_RNC_FR, AMR_RAB_Drop_Active_Drops_RNC_Fails = x.AMR_RAB_Drop_Active_Drops_RNC_Fails, AMR_RAB_Drop_Active_Drops_UE_FR = x.AMR_RAB_Drop_Active_Drops_UE_FR, AMR_RAB_Drop_Active_Drops_UE_Fails = x.AMR_RAB_Drop_Active_Drops_UE_Fails, CS_Conv_RAB_Setup_Access_Completitions = x.CS_Conv_RAB_Setup_Access_Completitions, CS_Conv_RAB_Retainability_Completitions = x.CS_Conv_RAB_Retainability_Completitions, CS_Conv_RAB_Active_Drops_IU_FR = x.CS_Conv_RAB_Active_Drops_IU_FR, CS_Conv_RAB_Active_Drops__IU_Fails = x.CS_Conv_RAB_Active_Drops__IU_Fails, CS_Conv_RAB_Active_Drops_Radio_FR = x.CS_Conv_RAB_Active_Drops_Radio_FR, CS_Conv_RAB_Active_Drops_Radio_Fails = x.CS_Conv_RAB_Active_Drops_Radio_Fails, CS_Conv_RAB_Active_Drops_BTS_FR = x.CS_Conv_RAB_Active_Drops_BTS_FR, CS_Conv_RAB_Active_Drops_BTS_Fails = x.CS_Conv_RAB_Active_Drops_BTS_Fails, CS_Conv_RAB_Active_Drops_IUR_FR = x.CS_Conv_RAB_Active_Drops_IUR_FR, CS_Conv_RAB_Active_Drops_IUR_Fails = x.CS_Conv_RAB_Active_Drops_IUR_Fails, CS_Conv_RAB_Active_Drops_RNC_FR = x.CS_Conv_RAB_Active_Drops_RNC_FR, CS_Conv_RAB_Active_Drops_RNC_Fails = x.CS_Conv_RAB_Active_Drops_RNC_Fails, CS_Conv_RAB_Active_Drops_UE_FR = x.CS_Conv_RAB_Active_Drops_UE_FR, CS_Conv_RAB_Active_Drops_UE_Fails = x.CS_Conv_RAB_Active_Drops_UE_Fails, Packet_Service_RAB_Setup_Access_Completitions = x.Packet_Service_RAB_Setup_Access_Completitions, Packet_Service_RAB_Retainability_Completitions = x.Packet_Service_RAB_Retainability_Completitions, Packet_Service_RAB_Active_Drops_IU_FR = x.Packet_Service_RAB_Active_Drops_IU_FR, Packet_Service_RAB_Active_Drops_Fails = x.Packet_Service_RAB_Active_Drops_Fails, Packet_Service_RAB_Active_Drops_Radio_FR = x.Packet_Service_RAB_Active_Drops_Radio_FR, Packet_Service_RAB_Active_Drops_Radio_Fails = x.Packet_Service_RAB_Active_Drops_Radio_Fails, Packet_Service_RAB_Active_Drops_BTS_FR = x.Packet_Service_RAB_Active_Drops_BTS_FR, Packet_Service_RAB_Active_Drops_BTS_Fails = x.Packet_Service_RAB_Active_Drops_BTS_Fails, Packet_Service_RAB_Active_Drops_IUR_FR = x.Packet_Service_RAB_Active_Drops_IUR_FR, Packet_Service_RAB_Active_Drops_IUR_Fails = x.Packet_Service_RAB_Active_Drops_IUR_Fails, Packet_Service_RAB_Active_Drops_RNC_FR = x.Packet_Service_RAB_Active_Drops_RNC_FR, Packet_Service_RAB_Active_Drops_RNC_Fails = x.Packet_Service_RAB_Active_Drops_RNC_Fails, Packet_Service_RAB_Active_Drops_UE_FR = x.Packet_Service_RAB_Active_Drops_UE_FR, Packet_Service_RAB_Active_Drops_UE_Fails = x.Packet_Service_RAB_Active_Drops_UE_Fails, Packet_Session_Rel_HSDSCH_EDCH = x.Packet_Session_Rel_HSDSCH_EDCH, Packet_Session_Rel_HSDSCH_DCH = x.Packet_Session_Rel_HSDSCH_DCH, Packet_Session_Rel_Alloc_Rel = x.Packet_Session_Rel_Alloc_Rel, Packet_Session_Success_Ratio_SR = x.Packet_Session_Success_Ratio_SR, Packet_Session_Drops_HSDSCH_EDCH_DR = x.Packet_Session_Drops_HSDSCH_EDCH_DR, Packet_Session_Drops_HSDSCH_EDCH_Drops = x.Packet_Session_Drops_HSDSCH_EDCH_Drops, Packet_Session_Drops_HSDSCH_DCH_DR = x.Packet_Session_Drops_HSDSCH_DCH_DR, Packet_Session_Drops_HSDSCH_DCH_Drops = x.Packet_Session_Drops_HSDSCH_DCH_Drops, Packet_Session_Drops_DCH_DR = x.Packet_Session_Drops_DCH_DR, Packet_Session_Drops_DCH_Drops = x.Packet_Session_Drops_DCH_Drops, Packet_Session_Drops_HSDSCH_EDCH_Other_DR = x.Packet_Session_Drops_HSDSCH_EDCH_Other_DR, Packet_Session_Drops_HSDSCH_EDCH_Other_Drops = x.Packet_Session_Drops_HSDSCH_EDCH_Other_Drops, Packet_Session_Drops_HSDSCH_DCH_Other_DR = x.Packet_Session_Drops_HSDSCH_DCH_Other_DR, Packet_Session_Drops_HSDSCH_DCH_Other_Drops = x.Packet_Session_Drops_HSDSCH_DCH_Other_Drops, Packet_Session_Drops_DCH_Other_DR = x.Packet_Session_Drops_DCH_Other_DR, Packet_Session_Drops_DCH_Other_Drops = x.Packet_Session_Drops_DCH_Other_Drops, HSDSCH_Alloc_Rel = x.HSDSCH_Alloc_Rel, HSDPA_Retain_NW = x.HSDPA_Retain_NW, HSDPA_Retain_RL_FR = x.HSDPA_Retain_RL_FR, HSDPA_Retain_Non_RL_FR = x.HSDPA_Retain_Non_RL_FR, HSDPA_Retain_Mobility_FR = x.HSDPA_Retain_Mobility_FR, HSDPA_Retain_PRE_EMPTION_FR = x.HSDPA_Retain_PRE_EMPTION_FR, HSDPA_Retain_Other_Mob_FR = x.HSDPA_Retain_Other_Mob_FR, EDCH_Alloc_Rel = x.EDCH_Alloc_Rel, HSUPA_Retain_NW = x.HSUPA_Retain_NW, HSUPA_Retain_RL_FR = x.HSUPA_Retain_RL_FR, HSUPA_Retain_EDCH_Rel_HSDSCH_SCC = x.HSUPA_Retain_EDCH_Rel_HSDSCH_SCC, HSUPA_Retain_Other_FR = x.HSUPA_Retain_Other_FR, HSDSCH_SCC_UE_FR = x.HSDSCH_SCC_UE_FR, HSDSCH_SCC_UE_Fails = x.HSDSCH_SCC_UE_Fails, HSDSCH_SCC_BTS_FR = x.HSDSCH_SCC_BTS_FR, HSDSCH_SCC_BTS_Fails = x.HSDSCH_SCC_BTS_Fails, HSDSCH_SCC_Trans_FR = x.HSDSCH_SCC_Trans_FR, HSDSCH_SCC_Trans_Fails = x.HSDSCH_SCC_Trans_Fails, HSDSCH_SCC_AC_FR = x.HSDSCH_SCC_AC_FR, HSDSCH_SCC_AC_Fails = x.HSDSCH_SCC_AC_Fails, HSDSCH_SCC_Other_FR = x.HSDSCH_SCC_Other_FR, HSDSCH_SCC_Other_Fails = x.HSDSCH_SCC_Other_Fails, R99_Alloc_Rel = x.R99_Alloc_Rel, R99_Retain_NW = x.R99_Retain_NW, Inter_RNC_SCC_Fail = x.Inter_RNC_SCC_Fail, Inter_RNC_SCC_Drop = x.Inter_RNC_SCC_Drop, RSRAN084_ID = y.RSRAN084_ID, PeriodStartTime2 = y.PeriodStartTime, RNC_Name2 = y.RNC_Name, WBTS_Name2 = y.WBTS_Name, WBTS_ID2 = y.WBTS_ID, WCEL_Name2 = y.WCEL_Name, WCEL_ID2 = y.WCEL_ID, Cell_Availability = y.Cell_Availability, Cell_Availability_Exclude = y.Cell_Availability_Exclude, RRC_Set_Att = y.RRC_Set_Att, RRC_Set_Acc_CR_NW = y.RRC_Set_Acc_CR_NW, RRC_Set_Acc_CR_UE = y.RRC_Set_Acc_CR_UE, RRC_Conn_Setup_SR = y.RRC_Conn_Setup_SR, RRC_Conn_SR = y.RRC_Conn_SR, RRC_Reg_Att = y.RRC_Reg_Att, Regist_SR = y.Regist_SR, RAB_Att_Voice = y.RAB_Att_Voice, RAB_STP_and_ACC_CR_Voice = y.RAB_STP_and_ACC_CR_Voice, RAB_SR_AMR_Voice = y.RAB_SR_AMR_Voice, Min_per_Drop_Voice = y.Min_per_Drop_Voice, CS_Serv_Dur_Voice = y.CS_Serv_Dur_Voice, RAB_Att_UDI = y.RAB_Att_UDI, RAB_Stp_Acc_SR = y.RAB_Stp_Acc_SR, RAB_SR_UDI = y.RAB_SR_UDI, Min_Per_Drop_UDI = y.Min_Per_Drop_UDI, CS_Serv_Dur_UDI = y.CS_Serv_Dur_UDI, PS_NRT_RAB_Att = y.PS_NRT_RAB_Att, PS_NRT_RAB_CR = y.PS_NRT_RAB_CR, PS_NRT_RAB_SR_NW = y.PS_NRT_RAB_SR_NW, PS_NRT_RAB_SR_User = y.PS_NRT_RAB_SR_User, Packet_Session_Att = y.Packet_Session_Att, Packet_Session_Stp_SR = y.Packet_Session_Stp_SR, RAB_Att_Stream = y.RAB_Att_Stream, RAB_Stp_Acc_SR_Stream = y.RAB_Stp_Acc_SR_Stream, RAB_SR_Stream = y.RAB_SR_Stream, M_RAB_Att = y.M_RAB_Att, M_RAB_Stp_Acc_SR = y.M_RAB_Stp_Acc_SR, M_RAB_SR = y.M_RAB_SR, SHO_Update_Att_RT = y.SHO_Update_Att_RT, SHO_Update_Att_NRT = y.SHO_Update_Att_NRT, SHO_SR_RT = y.SHO_SR_RT, SHO_SR_NRT = y.SHO_SR_NRT, SHO_Overhead = y.SHO_Overhead, Inter_Sys_HHO_Att_RT = y.Inter_Sys_HHO_Att_RT, Inter_Sys_HHO_Att_NRT = y.Inter_Sys_HHO_Att_NRT, Inter_Sys_HHO_RT_SR = y.Inter_Sys_HHO_RT_SR, Inter_Sys_HHOO_NRT_SR = y.Inter_Sys_HHOO_NRT_SR, Inter_Sys_HHO_RT_DR = y.Inter_Sys_HHO_RT_DR, Inter_Sys_HHO_NRT_DR = y.Inter_Sys_HHO_NRT_DR, Inc_IS_Change_Att = y.Inc_IS_Change_Att, Intra_Sys_HHO_Att = y.Intra_Sys_HHO_Att, Intra_Sys_HHO_SR = y.Intra_Sys_HHO_SR, R99_Allo_DL_DCH_Cap_Data_Call = y.R99_Allo_DL_DCH_Cap_Data_Call, R99_Allo_UL_DCH_Cap_Data_Call = y.R99_Allo_UL_DCH_Cap_Data_Call, HSDSCH_Selections = y.HSDSCH_Selections, HSDPA_Res_Acc_NRT = y.HSDPA_Res_Acc_NRT, HSDPA_Res_Retain_NRT = y.HSDPA_Res_Retain_NRT, HSDPA_Res_Retain_RT = y.HSDPA_Res_Retain_RT, HSDPA_Attempt = y.HSDPA_Attempt, HSDPA_SR = y.HSDPA_SR, Avg_MAC_D_THP = y.Avg_MAC_D_THP, Act_HSDSCH_MAC_D_THP_NW = y.Act_HSDSCH_MAC_D_THP_NW, HSDPA_DL_DATA_Rcvd_NodeB = y.HSDPA_DL_DATA_Rcvd_NodeB, HSDPA_MAC_HS_Data_Vol_at_RNC = y.HSDPA_MAC_HS_Data_Vol_at_RNC, HSPDA_MAC_HS_Efficiency = y.HSPDA_MAC_HS_Efficiency, HARQ_Non_Ack_Ratio_Mean = y.HARQ_Non_Ack_Ratio_Mean, HSDPA_SCC_Att = y.HSDPA_SCC_Att, E_DCH_Selections = y.E_DCH_Selections, HSUPA_Res_Acc_NRT = y.HSUPA_Res_Acc_NRT, HSUPA_Res_Retain_NRT = y.HSUPA_Res_Retain_NRT, HSUPA_Res_Retain_RT = y.HSUPA_Res_Retain_RT, HSUPA_Att = y.HSUPA_Att, HSUPA_SR = y.HSUPA_SR, HSUPA_MAC_es_Data_Vol_RNC = y.HSUPA_MAC_es_Data_Vol_RNC, HSUPA_MAC_es_BLER = y.HSUPA_MAC_es_BLER, E_DCH_HARQ_Non_Ack_Ratio = y.E_DCH_HARQ_Non_Ack_Ratio, HSUPA_SCC_Att = y.HSUPA_SCC_Att, AVG_CS_Traffic = y.AVG_CS_Traffic, Inc_SMS_Att = y.Inc_SMS_Att }; Chart1.DataSource = q; Chart1.Series[0].XValueMember = "PeriodStartTime"; Chart1.Series[0].YValueMembers = HiddenFieldSeries1.Value.ToString(); Chart1.Series.Add(HiddenFieldSeries2.Value); Chart1.Series[1].XValueMember = "PeriodstartTime2"; Chart1.Series[1].YValueMembers = HiddenFieldSeries2.Value.ToString(); } } Can We simplify Linq Select New codes?? while i only need 4 columns only.. :(
Your question dosen't make too much sense as far as your comments/labeling, so I took my best guess: DDLLessons.DataSource = lesson; DDLLessons.DataBind(); var query = from x in db.Scores where x.StudentName == DDLStudentName.SelectedItem.Value select new { Day = x.Day, Class = DDLLessons.SelectedItem.Value };
Are you looking for selecting table name dynamically using strings (this is what I understood). If yes, have a look at this and select the table object from the string: How can I dynamically select my Table at runtime with Dynamic LINQ From the above link, this is what is relevant to you: '' get the table from a type (which corresponds to a table in your database) Dim typeName = "DatabaseTest.AdventureWorks." & tableName & ", DatabaseTest" Dim entityType = Type.GetType(typeName) Dim table = dc.GetTable(entityType) Dim query As IQueryable = table (credit for the code goes to original poster of the answer on the link that I've provided) UPDATE: C# version of code: // get the table from a type (which corresponds to a table in your database) string typeName = "DatabaseTest.AdventureWorks." + tableName + ", DatabaseTest"; Type entityType = Type.GetType(typeName); object table = dc.GetTable(entityType); IQueryable query = table as IQueryable;