• Home
  • About
  • Contact
  • Advertise

Devlounge

Design, Develop, and Grow

ateşli sevgilisi fantezisini yaşamak istediğini söyler porno ona arkadaşları varken onunla gizli saklı seks yapmak istediğini sikiş söyleyen kız hafta sonu için gelen arkadaşının görmediği bir sikiş açıdan sakso çekmeye başlayınca adamın yarağını bu altyazılı porno şekilde indiremez ve açık şekilde salonda sikişimeye sex izle başladıklarında misafir kızı da bu sekslerine rokettube konuk ederler seks yapacağını düşünmeyerek onun sex izle oyun oynadığını zanneder sabah olur ve herkes uyanır hd porno bu sırada yanında şişme mankenini de getiren sapık erotik hikayeler genç sınav haftası ders çalışan genç adam üvey annesinin sikiş eve gelmesiyle hayatının şokunu yaşar

  • Home
  • Code
  • Design
  • Design Focus
  • Interviews
  • Publishing
  • Strategy
  • Webapps
  • Extras

XML Data Driven CSS Charts

October 23, 2008 By Nicholas Palacios

XML Data Driven CSS Charts? Whaaa!!!

No its not crazy talk. CSS Charts are possible nowadays and they can even be semantically correct. Let’s say you already have started using CSS based charts on your site. Wouldn’t it be nice if the CSS charts were update able via an XML file. You are in the right place! This technique is going to show you how to make accessible charts that are scalable and easy to update.

The Basic Structure Markup

Below you will find the basic structure for the chart. I used a definition list since it does a great job of showing relation between values. You could also use list items, but I didn’t like the way it looked semantically.

[html]

Chart Title
Unit 195%
Unit 275%
Unit 350%

Unit 425%
Unit 510%
Unit 635%
Various Units

[/html]

Style that Chart!

I am not going to go into a lot of detail about each part of the CSS. The basic structure is pretty straight forward and doesn’t require you be a brain surgeon. Please see the CSS file located in the source zip at the end of the post. I am however going to talk about some of the CSS that controls the height and color.

Heights

The height of the bars in this tutorial are controlled by CSS so it is required that you create classes for the various heights so the XML parser can associate. I create the heights in 5% increments, you can changed to whatever you want.

Here is a snippet of the heights:

[css]
dl.xmlGraph.vertical dd dl dd span.h5 { height:5%; }
dl.xmlGraph.vertical dd dl dd span.h95 { height:95%; }
dl.xmlGraph.vertical dd dl dd span.h100 { height:100%; }
[/css]

Colors

We are going to create a few generic colors that we will offer as options for the bar colors.

[css]
.green { background-color:#009900; }
.lghtGreen { background-color:#8fad53; }
.lghtOrange { background-color:#CC9900; }
[/css]

The Data Structure

Now lets get into the meat of this technique. The data! As you already know the data is going to be stored in an XML file. Below is the generic structure.

[html]

Chart Title
Various Units
Complete










[/html]

The Data Parser

This is where the technique really starts to come together. We now start utilizing both the XML file and CSS selectors to achieve our goal…data driven charts! Below is a snippet of the parser so you can get an idea of what were trying to do and get the basic jist of things. The full files will be available at the end of this article so you can dissect.

[code]
<%

If graphTitle “” Then
stringBuffer = “

Chart Title

”
stringBuffer = stringBuffer & “

” & vbCrLf
If graphTitle “” Then stringBuffer = stringBuffer & “

” & graphTitle & “

” & vbCrLf
stringBuffer = stringBuffer & “

” & vbCrLf
End If
stringBuffer = stringBuffer & “

” & vbCrLf & “

” & vbCrLf
stringBuffer = stringBuffer & “

” & vbCrLf

Dim params
Set params = graphXML.selectNodes(“//params”)
Set sets = graphXML.selectNodes(“//set”)

x = 0

For each valset in sets
If x = 0 Then
classAttribute = ” class=””first”””
ElseIf x = (sets.length – 1) Then
classAttribute = ” class=””last”””
Else
classAttribute = “”
End If

x = x + 1

Set attribs = valset.attributes
setName = “”
setValue = “”
setColor = “”
For each attrib in attribs
If attrib.name = “name” Then setName = attrib.text
If attrib.name = “value” Then setValue = attrib.text
If attrib.name = “color” Then setColor = attrib.text
Next
stringBuffer = stringBuffer & “

” & vbCrLf

If setName “”
Then stringBuffer = stringBuffer & vbTab & “” & setName & “” & vbCrLf

If setValue “”
Then stringBuffer = stringBuffer & vbTab & “” & setValue & “%” & vbCrLf
stringBuffer = stringBuffer & “

” & vbCrLf
onFirst = false

Next
stringBuffer = stringBuffer & “

” & vbCrLf & “

” & vbCrLf
response.Write(stringBuffer)

%>
[/code]

Keep in mind that it’s always a good idea to have error handling in place to handle any kind of exception that can occur. I didn’t include in code snippet due to space constraints, plus I didn’t want to bore you guys.

The Final Product

This is how you would structure your ASP page to finally bring all the elements together. Just by calling the ASP file in as a file include then reference the below code in the body.

[html]

[/html]

[html]
<% Call CreateGraph("xmlData.xml ") %>
[/html]

Below I created an example page utilizing the techniques discussed in this article. I have also attached the source file so you can rummage through the code. I am always open to new methods…drop me line and well discuss.

Happy charting!!!

DEMO: view page

Source Files: download

Pulling XML into Flash

January 22, 2008 By Brian Self

When developers and designers start really utilizing the power of flash and the potential it can bring to applications and creative content, a question that frequently arises is how to load data in from a xml page and use it in Flash. This is a quick tutorial to show how easy the process is and once you have these basics the possibilities are endless.

First we will create a simple xml document called images.xml. Here is the code:

<images> <image image="img/img1.jpg" caption="Brian Self- Flash Programmer"/> </images>

We are only going to use one simple xml node to keep it simple. Save this file in a directory called xml.

Then create an FLA and call it “Main.” Put a dyncamic text field on the stage with an instance name of myText and be sure to embed the font, uppercase, lowercase and punctuation. Then draw a rectangle and hit F8 to make it a movieClip and give it an instance name of myImageHolder.

Then create an AS layer and paste in this code:

// create the XML variable var xml:XML = new XML(); // you must ignore whitespace xml.ignoreWhite = true; // the function that is called when the xml is loaded xml.onLoad = function() { // tells you the number of child nodes var nodes = this.firstChild.childNodes; // tells you how many items you have numOfItems = nodes.length; // attach icons for (var i = 0; i<numOfItems; i++) { // attach image to the myImageHolder MovieClip myImageHolder.loadMovie(nodes[i].attributes.image); // set the text myText.text = nodes[i].attributes.caption; } }; // load the xml xml.load("xml/images.xml");

If you run this you will see that the content is now populated from the xml page.

Simple as that! Remember, in coding and designing there is always an increasingly difficult way of doing things and a elequently simple way. Keeping it simple makes debugging a quick and painless process and always assume you will have to debug at some point in your designing life.

Out of the Box

October 18, 2006 By The Team

Out of the Box

Welcome to the first addition of my new weekly column. I often wonder what makes a lot of these columnists legitment, and I don’t mean names like Cameron Moll, Andy Budd, Dave Shea, or the countless other web developers who have made a universal name for themselves on the internet through actual book publishings and the countless seminars they speak at. Sometimes I read comments and articles that seem to be written from the perspective of a fourteen year old, for fourteen year olds. As a result, I thought I should take some time before we get started to just list my own credentials. I am a college graduate from Durham College in Oshawa Ontario, and as a result I have had classes in a little bit of everything ranging from CSS and design to the server side scripting languages such as PHP and ASP. I graduated after a two year program as one of seven from an initial class of thirty five. By the time I graduated I was working with two popular web design companies in the Oshawa/Durham region as well as participating in freelance work. Almost six months ago, I left these two companies to work for the Royal Bank, where I worked with a development team to overhaul the internal web site that is used for the Investment Advisor. I also work along side the marketing department for the Investment Advisor’s web sites. I have also just finished a web site for Golfing Buddies Inc. (This web site is a story in itself!) which is a national company across Canada already, selling golfing books that attempt to help improve your golf game.

I am not trying to gloat, or try and seem like I am better then I am, in fact it’s really the opposite. I want everyone reading this to believe that I at least have some experience in my field, and that I am not basing everything on what could be, or what if. So with all this stated, I would like to bring up my topic of interest, assuming you’re still reading of course. As I am sure everyone knows, the white canvas can be a frustrating place to be in, when you are attempting to create work for a client. I’ve been there, and I know just how frustrating it can be. However, my topic won’t be covering that, bet I fooled you! Instead, it’s about something very similar, and very frustrating, if not more frustrating. This topic being, the inability to leave the comfort zone you’ve created for yourself. My topic is about stepping out of the box.

Now before we keep going, and you all roll your eyes and say “Been here, heard that” I am not saying use a red arial font, instead of a blue times new roman font. I am talking about complete rehaul of your style. Some of you may have already decided that you don’t have an exact style yet, or you are always thinking out of the box, but let me ask a question. Are all your layouts fixed or liquid? Do you have all your navigation’s at the top? Are you a fan of using stock photography as the main header? Do you using the same font style all the time? Do you prefer specific colors all the time? Are yo…. OK, I guess you have the picture. If you can truthfully answer NO to all of those things without even hesitating, then you MUST be a design guru… or blind. The fact of the matter is, every single designer and developer has a specific style when they are creating their web sites, and the problem with this, is that after a while we don’t offer anything new to our clients. Are work becomes the same, and all of sudden we have our own little Web 2.0 look on every web site. A great designer knows how to switch it up all the time, but that can only be done over years. However, the first part is identifying it. Usually it takes someone grabbing you, shaking you, and saying “THIS ALL LOOKS THE SAME!” Being close with about fourteen designers in my class, I saw this all the time. One girl in my class was very talented, but at the exact same time, she was known to repeat certain elements in her designs. She refused to use anything other then 10px arial. She used mostly pinks, blues, and purples. Every layout was centered, no border, solid background. Looking through her portfolio, with every page flipped, you felt like you were looking at the same site, just slightly altered with a new logo. Of course, I wasn’t really innocent either. I was notorious for the fixed, centered, one pixel black borders, with a pixel background, and a combination of arial and georgia. I could go on, and list off every single designer in my class this way, but that would be a waste of time, because I assume you all have the picture. Our problem was that we’d all, as is the case with nearly every designer, had found our comfort zone and we needed to break out of the box and created something more. We never realized it, until we had someone else tell us we needed to diversify.

Thinking out of the box doesn’t just apply to our design abilities, it also can be applied to client work and requirements that don’t seem “possible” at first. At my work, one of their biggest requirements is user interaction. This means forms, and large menus that should only be updated by one file. What’s the catch? No server side scripting is possible due to security restrictions. My example for this, is a set of landing pages, all designed with dozens of links on each page. So far, it wasn’t too much of an issue since only one page needed the list of links. I only need to edit that one page, and we’re done. Now the problem at hand, however, was the main navigation which had to be identical on every single page, which was about twelve pages over all. I could have gone in, and updated each page individually. That means big changes for each page could take more time then allotted, since each change needed to be repeated and tested. It felt beyond impossible to do, since I wasn’t able to call on a simple include script for the navigation file and solve my problems like I was used to. I was in a position where my employer wanted something, and due to their restrictions I couldn’t provide! The most frustrating thing about it all was I knew how, and wasn’t able to do it. That’s when I realized that I needed to think outside of the box. Since I couldn’t rely on asp or php, I had to improvise I use what I knew. The result was a combination of XML, and Actionscript. In what resulted to be one of the most unconventional navigation techniques, everything was set up in XML, where I provided a link title and a url. Then in flash, I used actionscript and called for the XML to populate the menu system. While navigation techniques are used all over the web already, at a bank where their requests usually come along the lines of “We want you to make something that look great, and simple, and easy to navigate, and easy to use… but absolutely no graphics, just text” you don’t see too many interactive, graphic friendly interfaces. Due to this technique, a large positive feedback occurred, as everyone ended up enjoying the more graphic friendly interface. Not only did I solve my navigation problems, I also integrated something the bank wasn’t used to, and so I received praise on an easy and effective way to update as well as a good looking interface that was still able to meet the look of the bank. Of course, sometimes, you’ll find that even with looking at options outside the norm, somethings just cannot be done. My new task is to create a form, that saves to an xml file once submitted and then can be than be released to the public at a later time by means of a html styled e-mail newsletter… all without any server side scripting. While I am still looking for options through javascript, and flash, it is appearing to be more difficult then first expected.

The over all point I am trying to make, is we all get stuck in our own comfort zones, should they be on a design side or a development side. We have our styles and we struggle and refuse to break away from them. It isn’t until you are able to break out of the box, are you able to grow as a web designer and web developer. You need to push yourself to do something new, and learn new techniques. Our own comfort zones are aids to all of us, but they can also stop us from growing as well. After all, once you’re all done you will probably end up saying to yourself “I’m glad I stepped out of the box, this is the best work I’ve created to date.”

Thanks for reading,
Andrew Kelly

Code & Tutorials

Which Front-End Development Languages Will Grow in 2017?

Your Guide to Leveraging APIs as a Developer

Bitcoin Processing Website Integration For Web Developers

Website Security For 2016 That All Developers Need To Know

5 Reasons You Need to Be Using jQuery

About Devlounge

Want to read more about Devlounge, or maybe you want to contact us, or even advertise? Oh, and don't forget to subscribe to updates!

The Best of Devlounge

Facebook Pages Design

Facebook Page Design and Tutorials

Search